Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code sign macOS binaries #65

Merged
merged 1 commit into from
Dec 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
cp .\Release\* ..\artifacts\$env:ARCH
env:
ARCH: Win32
- name: Sign generated DLLs
- name: Code signing binaries
uses: azure/[email protected]
if: env.CODESIGN == 'true'
with:
Expand Down Expand Up @@ -105,8 +105,17 @@ jobs:
runs-on: macos-13
env:
MACOSX_DEPLOYMENT_TARGET: "10.10"
CODESIGN: ${{ !!secrets.CODESIGN_MACOS_P12_URL }}
steps:
- uses: actions/checkout@v4
- name: Cache apple-codesign
uses: actions/cache@v2
with:
path: |
~/.cargo/bin
~/.cargo/git
~/.cargo/registry
key: ${{ runner.os }}-cargo }}
- name: Build
run: |
mkdir build
Expand All @@ -127,11 +136,35 @@ jobs:
done
cp -Rv include artifacts/
cp -v ../COPYING ../README ../ChangeLog artifacts
- name: Prepare code signing certificate
if: env.CODESIGN == 'true'
run: |
pip3 install awscli
aws s3 cp "$CODESIGN_MACOS_P12_URL" ./appledev.p12
cargo install apple-codesign
env:
AWS_DEFAULT_REGION: eu-central-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CODESIGN_MACOS_P12_URL: ${{ secrets.CODESIGN_MACOS_P12_URL }}
- name: Code signing binaries
if: env.CODESIGN == 'true'
run: |
for arch in arm64 x86_64 universal2; do
rcodesign sign \
--p12-file appledev.p12 \
--p12-password "$CODESIGN_MACOS_P12_PASSWORD" \
build/artifacts/${arch}/libdiscid.0.dylib
done
env:
CODESIGN_MACOS_P12_PASSWORD: ${{ secrets.CODESIGN_MACOS_P12_PASSWORD }}
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: libdiscid-macos
path: build/artifacts
- name: Code signing cleanup
run: rm ./appledev.p12

release:
runs-on: ubuntu-latest
Expand Down
Loading