Skip to content

Commit acb34c8

Browse files
committed
Update action.yaml
1 parent 7249f5b commit acb34c8

1 file changed

Lines changed: 24 additions & 49 deletions

File tree

sign-pkg-mac/action.yaml

Lines changed: 24 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,25 @@ runs:
9393
app_bundle="$(ls -dt .app/*.app | head -n 1)"
9494
"${{ github.action_path }}/sign.sh" "$app_bundle"
9595
96-
# Velopack packaging — runs AFTER signing so that the nupkg and
97-
# Portable.zip contain signed binaries. vpk injects UpdateMac and
98-
# sq.version, signs only its own additions (UpdateMac), and produces
99-
# the nupkg and Portable.zip.
96+
- name: Store notarytool credentials
97+
if: ${{ inputs.velopack_pack_id }}
98+
shell: bash
99+
env:
100+
note_user: "${{ inputs.note_user }}"
101+
note_pass: "${{ inputs.note_pass }}"
102+
note_team: "${{ inputs.note_team }}"
103+
run: |
104+
set -x -e
105+
xcrun notarytool store-credentials "velopack-notary" \
106+
--apple-id "$note_user" \
107+
--password "$note_pass" \
108+
--team-id "$note_team" \
109+
--keychain "$HOME/Library/Keychains/viewer.keychain-db"
110+
111+
# Velopack packaging — runs AFTER signing. vpk injects UpdateMac and
112+
# sq.version, signs its own additions, notarizes the entire bundle
113+
# (including our pre-signed binaries), and produces the nupkg and
114+
# Portable.zip.
100115
- name: Setup Velopack CLI
101116
if: ${{ inputs.velopack_pack_id }}
102117
uses: secondlife/viewer-build-util/setup-velopack@geenz/velopack
@@ -119,6 +134,7 @@ runs:
119134
# --signDisableDeep: don't re-sign our pre-signed binaries
120135
# --signAppIdentity: sign only what vpk adds (UpdateMac, top-level bundle)
121136
# --signEntitlements: use our entitlements for UpdateMac
137+
# --notaryProfile: notarize the final bundle (covers all binaries)
122138
vpk pack \
123139
--packId "$PACK_ID" \
124140
--packVersion "$PACK_VERSION" \
@@ -132,6 +148,7 @@ runs:
132148
--signAppIdentity "$CERT_NAME" \
133149
--signEntitlements "${{ github.action_path }}/installer/slplugin.entitlements" \
134150
--signDisableDeep \
151+
--notaryProfile "velopack-notary" \
135152
--keychain "$HOME/Library/Keychains/viewer.keychain-db"
136153
137154
- name: Replace app bundle with Velopack-ready version
@@ -164,59 +181,17 @@ runs:
164181
echo "::warning::UpdateMac binary not found in extracted bundle"
165182
fi
166183
167-
- name: Re-sign, notarize, and staple the Velopack-ready bundle
184+
- name: Staple and validate the Velopack-ready bundle
168185
if: ${{ inputs.velopack_pack_id }}
169186
shell: bash
170-
env:
171-
cert_name: "${{ inputs.cert_name }}"
172-
note_user: "${{ inputs.note_user }}"
173-
note_pass: "${{ inputs.note_pass }}"
174-
note_team: "${{ inputs.note_team }}"
175187
run: |
176188
set -x -e
177189
app_bundle="$(ls -dt .app/*.app | head -n 1)"
178-
entitlements="${{ github.action_path }}/installer/slplugin.entitlements"
179-
180-
# vpk added UpdateMac and sq.version which invalidates the top-level
181-
# bundle signature and notarization ticket. Inner binaries are still
182-
# signed from sign.sh. Re-sign the top-level bundle to seal the new
183-
# contents, then notarize and staple the final result.
184-
/usr/bin/codesign --force --deep --timestamp --options runtime \
185-
--entitlements "$entitlements" --keychain viewer.keychain \
186-
--sign "$cert_name" "$app_bundle"
187-
188-
# Verify signature
189-
codesign -vvvv "$app_bundle"
190190
191-
# Notarize
192-
echo "Creating notarization archive"
193-
app_base="$(basename "$app_bundle")"
194-
zip_file="$RUNNER_TEMP/${app_base/.app/.zip}"
195-
ditto -c -k --keepParent "$app_bundle" "$zip_file"
196-
197-
credentials=(--apple-id "$note_user" --password "$note_pass" --team-id "$note_team")
198-
199-
echo "Submitting for notarization"
200-
set +e
201-
output="$(xcrun notarytool submit "$zip_file" --wait \
202-
"${credentials[@]}" 2>&1 | \
203-
tee /dev/stderr ; \
204-
exit "${PIPESTATUS[0]}")"
205-
rc=$?
206-
set +x
207-
[[ "$output" =~ 'id: '([^[:space:]]+) ]]
208-
match=$?
209-
set -x
210-
if [[ $match -eq 0 ]]; then
211-
xcrun notarytool log "${BASH_REMATCH[1]}" "${credentials[@]}"
212-
fi
213-
rm -f "$zip_file"
214-
[[ $rc -ne 0 ]] && exit $rc
215-
set -e
216-
217-
# Staple and validate
191+
# vpk already notarized the bundle. Staple the ticket and validate.
218192
xcrun stapler staple "$app_bundle"
219193
xcrun stapler validate "$app_bundle"
194+
codesign -vvvv "$app_bundle"
220195
spctl -a -texec -vvvv "$app_bundle"
221196
222197
- name: Set up the app sparseimage

0 commit comments

Comments
 (0)