Skip to content

Commit fff2daa

Browse files
committed
ci(release): separate signed and unsigned build paths
1 parent 7d8502b commit fff2daa

File tree

1 file changed

+40
-7
lines changed

1 file changed

+40
-7
lines changed

.github/workflows/release-rc.yml

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,42 +23,52 @@ jobs:
2323
permissions:
2424
contents: read
2525
env:
26-
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
27-
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
28-
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
29-
APPLE_ID: ${{ secrets.APPLE_ID }}
30-
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
31-
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
3226
RUN_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
3327
steps:
3428
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
29+
3530
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
3631
with:
3732
node-version: 20
3833
cache: npm
34+
3935
- uses: dtolnay/rust-toolchain@master
4036
with:
4137
toolchain: stable
38+
4239
- run: npm ci
4340
- run: npm run build
41+
4442
- name: Detect signing readiness
4543
id: signing
4644
shell: bash
45+
env:
46+
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
47+
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
48+
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
49+
APPLE_ID: ${{ secrets.APPLE_ID }}
50+
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
51+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
4752
run: |
4853
set -euo pipefail
4954
if [[ -n "${APPLE_CERTIFICATE}" && -n "${APPLE_CERTIFICATE_PASSWORD}" && -n "${APPLE_SIGNING_IDENTITY}" && -n "${APPLE_ID}" && -n "${APPLE_PASSWORD}" && -n "${APPLE_TEAM_ID}" ]]; then
5055
echo "mode=signed" >> "$GITHUB_OUTPUT"
5156
else
5257
echo "mode=unsigned" >> "$GITHUB_OUTPUT"
5358
fi
59+
5460
- name: Enforce signed mode when required
5561
if: ${{ inputs.require_signed && steps.signing.outputs.mode != 'signed' }}
5662
run: |
5763
echo "Signed mode required, but one or more APPLE_* secrets are missing."
5864
exit 1
65+
5966
- name: Install signing certificate
6067
if: ${{ steps.signing.outputs.mode == 'signed' }}
6168
shell: bash
69+
env:
70+
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
71+
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
6272
run: |
6373
set -euo pipefail
6474
KEYCHAIN_PASSWORD="$(openssl rand -base64 24)"
@@ -72,26 +82,49 @@ jobs:
7282
security import "$CERT_PATH" -k "$KEYCHAIN_PATH" -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign -T /usr/bin/security
7383
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
7484
security find-identity -v -p codesigning "$KEYCHAIN_PATH"
85+
7586
- name: Detect hardened runtime setting
7687
id: hardening
7788
shell: bash
7889
run: |
7990
set -euo pipefail
8091
node -e "const fs=require('fs'); const cfg=JSON.parse(fs.readFileSync('src-tauri/tauri.conf.json','utf8')); const enabled = cfg && cfg.bundle && cfg.bundle.macOS && cfg.bundle.macOS.hardenedRuntime === true; process.stdout.write('status=' + (enabled ? 'enabled' : 'disabled') + '\n');" >> "$GITHUB_OUTPUT"
81-
- name: Build RC artifact
92+
93+
- name: Build RC artifact (signed)
94+
if: ${{ steps.signing.outputs.mode == 'signed' }}
95+
env:
96+
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
97+
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
98+
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
99+
APPLE_ID: ${{ secrets.APPLE_ID }}
100+
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
101+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
82102
run: npm run tauri -- build
103+
104+
- name: Build RC artifact (unsigned)
105+
if: ${{ steps.signing.outputs.mode != 'signed' }}
106+
shell: bash
107+
run: |
108+
set -euo pipefail
109+
unset APPLE_CERTIFICATE APPLE_CERTIFICATE_PASSWORD APPLE_SIGNING_IDENTITY APPLE_ID APPLE_PASSWORD APPLE_TEAM_ID
110+
npm run tauri -- build
111+
83112
- name: Verify macOS artifact integrity
84113
id: verify_artifact
85114
shell: bash
115+
env:
116+
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
86117
run: |
87118
set -euo pipefail
88119
bash scripts/release/verify-macos-artifact.sh "src-tauri/target/release/bundle" "${{ steps.signing.outputs.mode }}"
120+
89121
- name: Upload RC bundle artifacts
90122
uses: actions/upload-artifact@v4
91123
with:
92124
name: auraforge-${{ github.run_number }}-${{ steps.signing.outputs.mode }}-${{ inputs.channel }}
93125
path: |
94126
src-tauri/target/release/bundle/**
127+
95128
- name: Release summary
96129
run: |
97130
{

0 commit comments

Comments
 (0)