Skip to content

Commit d6f5bbf

Browse files
committed
ci: zip hack for .app
1 parent 0fff9e9 commit d6f5bbf

File tree

1 file changed

+43
-24
lines changed

1 file changed

+43
-24
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ jobs:
161161
APP_PATH="src-tauri/target/release/bundle/macos/gptme-tauri.app"
162162
DMG_DIR="src-tauri/target/release/bundle/dmg"
163163
DMG_PATH="$DMG_DIR/gptme-tauri_${{ matrix.arch }}.dmg"
164+
ZIP_PATH="$DMG_DIR/gptme-tauri_${{ matrix.arch }}.app.zip"
164165
mkdir -p "$DMG_DIR"
165166
166167
echo "Signing app bundle at $APP_PATH"
@@ -192,41 +193,59 @@ jobs:
192193
echo "Signing DMG file"
193194
codesign --force -s "$APPLE_SIGNING_IDENTITY" --keychain build.keychain "$DMG_PATH"
194195
195-
echo "App and DMG signed successfully"
196+
echo "Creating ZIP archive of .app bundle"
197+
# Zip the .app bundle for distribution
198+
ditto -c -k --keepParent "$APP_PATH" "$ZIP_PATH"
196199
197-
# - name: Notarize macOS app (optional)
198-
# if: matrix.platform == 'macos-latest' && (startsWith(github.ref, 'refs/tags/') || github.event.inputs.sign == 'true')
199-
# env:
200-
# APPLE_ID: ${{ secrets.APPLE_ID }}
201-
# APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
202-
# APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
203-
# run: |
204-
# if [ -z "$APPLE_ID" ] || [ -z "$APPLE_ID_PASSWORD" ] || [ -z "$APPLE_TEAM_ID" ]; then
205-
# echo "Warning: Apple notarization credentials not available. Skipping notarization."
206-
# exit 0
207-
# fi
200+
# Sign the ZIP file (optional but recommended)
201+
codesign --force -s "$APPLE_SIGNING_IDENTITY" --keychain build.keychain "$ZIP_PATH"
208202
209-
# # Use the same DMG path as defined in the sign step
210-
# echo "Using DMG path for notarization: $DMG_PATH"
203+
echo "App, DMG, and ZIP archive created and signed successfully"
211204
212-
# echo "Uploading DMG for notarization"
213-
# xcrun notarytool submit "$DMG_PATH" \
214-
# --apple-id "$APPLE_ID" \
215-
# --password "$APPLE_ID_PASSWORD" \
216-
# --team-id "$APPLE_TEAM_ID" \
217-
# --wait
205+
- name: Notarize macOS app (optional)
206+
if: matrix.platform == 'macos-latest' && (startsWith(github.ref, 'refs/tags/') || github.event.inputs.sign == 'true')
207+
env:
208+
APPLE_ID: ${{ secrets.APPLE_ID }}
209+
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
210+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
211+
run: |
212+
if [ -z "$APPLE_ID" ] || [ -z "$APPLE_ID_PASSWORD" ] || [ -z "$APPLE_TEAM_ID" ]; then
213+
echo "Warning: Apple notarization credentials not available. Skipping notarization."
214+
exit 0
215+
fi
216+
217+
# Use the same DMG and ZIP paths as defined in the sign step
218+
echo "Using DMG path for notarization: $DMG_PATH"
219+
echo "Using ZIP path for notarization: $ZIP_PATH"
220+
221+
echo "Uploading DMG for notarization"
222+
xcrun notarytool submit "$DMG_PATH" \
223+
--apple-id "$APPLE_ID" \
224+
--password "$APPLE_ID_PASSWORD" \
225+
--team-id "$APPLE_TEAM_ID" \
226+
--wait
227+
228+
echo "Stapling notarization ticket to DMG"
229+
xcrun stapler staple "$DMG_PATH"
230+
231+
echo "Uploading ZIP for notarization"
232+
xcrun notarytool submit "$ZIP_PATH" \
233+
--apple-id "$APPLE_ID" \
234+
--password "$APPLE_ID_PASSWORD" \
235+
--team-id "$APPLE_TEAM_ID" \
236+
--wait
218237
219-
# echo "Stapling notarization ticket to DMG"
220-
# xcrun stapler staple "$DMG_PATH"
238+
echo "Stapling notarization ticket to ZIP"
239+
xcrun stapler staple "$ZIP_PATH"
221240
222-
# echo "Notarization complete"
241+
echo "Notarization complete for both DMG and ZIP"
223242
224243
- name: Upload macOS binaries to release
225244
if: matrix.platform == 'macos-latest' && startsWith(github.ref, 'refs/tags/')
226245
uses: softprops/action-gh-release@v1
227246
with:
228247
files: |
229-
src-tauri/target/release/bundle/macos/gptme-tauri.app
248+
src-tauri/target/release/bundle/dmg/gptme-tauri_${{ matrix.arch }}.app.zip
230249
src-tauri/target/release/bundle/dmg/gptme-tauri_${{ matrix.arch }}.dmg
231250
tag_name: ${{ github.ref_name }}
232251
name: gptme-tauri ${{ github.ref_name }}

0 commit comments

Comments
 (0)