Skip to content

Commit 95444a5

Browse files
committed
Ship the release dmg and zip with their notarization stapled (issue #650)
Both artifacts on the releases page are notarized but carry no ticket, so Gatekeeper has to ask Apple about them at first launch rather than read the ticket out of the download, and a machine that is offline refuses to open a freshly downloaded copy. The dmg and the zip were sealed one step before the stapler ran, and the app it stapled only ever reached a second zip that nothing uploads. * Separate exporting the signed app from packaging it, so the two can sit either side of notarization * Package the dmg and zip once the app has been stapled, so that the ticket is inside what ships * Say where the split comes from, since a dmg made ahead of the stapler carries no ticket whatever is done to the app afterwards
1 parent 583def9 commit 95444a5

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

‎.github/workflows/BuildPR.yml‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ jobs:
188188
EXPORT_OPTIONS_PATH=$RUNNER_TEMP/ExportOptions.plist
189189
echo -n "$EXPORT_OPTIONS" > "$EXPORT_OPTIONS_PATH"
190190
echo "EXPORT_OPTIONS_PATH=$EXPORT_OPTIONS_PATH"
191-
echo "Create GitX-${{ matrix.abi }}.dmg"
192-
make package-signed \
191+
echo "Export GitX.app"
192+
make export-signed \
193193
ARCH=${{ matrix.abi }} \
194194
ARCHIVE=GitX.xcarchive \
195195
EXPORT_DIR=. \
@@ -234,6 +234,16 @@ jobs:
234234
- name: Check Notarization
235235
if: ${{ env.variableSet != '' }}
236236
run: spctl -a -vv GitX.app
237+
- name: Package the stapled app
238+
if: ${{ env.variableSet != '' }}
239+
run: |
240+
echo "Create GitX-${{ matrix.abi }}.dmg and .zip from the stapled app"
241+
make package-signed \
242+
ARCH=${{ matrix.abi }} \
243+
EXPORT_DIR=. \
244+
DMG=GitX-${{ matrix.abi }}.dmg \
245+
ZIP=GitX-${{ matrix.abi }}.zip
246+
xcrun stapler validate GitX.app
237247
- name: Upload dmg
238248
uses: actions/upload-artifact@v7
239249
if: ${{ success() }}

‎Makefile‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ TEST_SETTINGS := CODE_SIGN_IDENTITY="-" ENABLE_HARDENED_RUNTIME=NO
7777

7878
.PHONY: help git-submodule-sync deps pre-build bootstrap build unit-test test \
7979
ui-test all-tests archive build-project app smoke-test run dmg map \
80+
export-signed \
8081
package-signed \
8182
dmg-signed clean git-clean-dry-run
8283

@@ -201,13 +202,19 @@ dmg: app ## Package build/GitX.app into an unsigned disk image that runs locally
201202

202203
# Clears the exported app rather than the directory holding it, since CI
203204
# exports into the checkout itself and that is not ours to delete.
204-
package-signed: ## Package an archive that already exists (needs ExportOptions.plist)
205+
export-signed: ## Export the signed app from an archive that already exists
205206
@test -f $(EXPORT_OPTIONS) \
206207
|| { echo "No $(EXPORT_OPTIONS); see EXPORT_OPTIONS in the Makefile"; exit 1; }
207208
rm -rf $(EXPORT_DIR)/GitX.app $(BUILD_DIR)/dist $(DMG) $(ZIP)
208209
mkdir -p $(EXPORT_DIR)
209210
xcodebuild -exportArchive -archivePath $(ARCHIVE) \
210211
-exportPath $(EXPORT_DIR) -exportOptionsPlist $(EXPORT_OPTIONS)
212+
213+
# Kept apart from the export so that notarization can staple the exported app
214+
# before it is sealed into anything: a dmg or zip made ahead of the stapler
215+
# carries no ticket, whatever is done to the app afterwards.
216+
package-signed: ## Package the exported app (run export-signed first)
217+
rm -rf $(BUILD_DIR)/dist $(DMG) $(ZIP)
211218
mkdir -p $(BUILD_DIR)/dist
212219
cp -R $(EXPORT_DIR)/GitX.app $(BUILD_DIR)/dist/
213220
ln -s /Applications $(BUILD_DIR)/dist/
@@ -220,6 +227,7 @@ package-signed: ## Package an archive that already exists (needs ExportOptions.p
220227
# Packaging runs as its own make so that it cannot start before the archive
221228
# has finished. CI archives in a step of its own and calls package-signed.
222229
dmg-signed: archive ## Build and package a signed disk image and zip
230+
$(MAKE) export-signed
223231
$(MAKE) package-signed
224232

225233
clean: ## Remove the build directory and Xcode's build products

0 commit comments

Comments
 (0)