Skip to content

Commit c334c0b

Browse files
attempt to manually notarize
1 parent 938302f commit c334c0b

File tree

1 file changed

+44
-17
lines changed

1 file changed

+44
-17
lines changed

.github/workflows/build.yml

+44-17
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,60 @@ jobs:
3535
run: npm run react-build
3636

3737
# ---------------------------------
38-
# macOS Build & Notarization (API Key)
38+
# macOS Build (Sign only, no auto-notarize)
3939
# ---------------------------------
4040
- name: Print environment for debugging
4141
if: matrix.os == 'macos-latest'
4242
run: printenv | sort
43-
- name: Build Electron app (macOS)
43+
44+
- name: Build & Sign Electron app (macOS)
4445
if: matrix.os == 'macos-latest'
4546
env:
46-
# Use Apple API key for notarization:
47-
APPLE_API_KEY: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }}
48-
APPLE_API_KEY_ID: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY_ID }}
49-
APPLE_API_ISSUER: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_UUID }}
50-
51-
# Developer ID certificate & password for code signing:
47+
# Provide ONLY the .p12 certificate for code signing.
5248
CSC_LINK: ${{ secrets.MACOS_CERTIFICATE }}
5349
CSC_KEY_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
5450

55-
# If your package.json notarize block references teamId:
56-
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
57-
58-
# Debug logging for electron-builder
51+
# Remove or omit the Apple API key vars from electron-builder,
52+
# so it doesn't attempt notarization internally.
5953
DEBUG: electron-builder
60-
61-
# GitHub token (only if needed for publishing)
6254
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
run: |
56+
# Remove any "notarize" block from package.json or set "notarize": false
57+
# to ensure electron-builder won't attempt notarization automatically.
58+
npm run electron-build
6359
64-
run: npm run electron-build
60+
- name: Submit app for notarization
61+
if: matrix.os == 'macos-latest'
62+
run: |
63+
# We'll assume your DMG name matches something like:
64+
# dist/Drivechain-Launcher-<version>-x64.dmg
65+
# If you produce multiple DMGs (x64, arm64), pick the correct one or do both.
66+
DMG_FILE=$(ls dist/*-x64.dmg | head -n 1)
67+
if [ -z "$DMG_FILE" ]; then
68+
echo "No x64 DMG found to notarize!"
69+
exit 1
70+
fi
71+
echo "Submitting $DMG_FILE for notarization..."
72+
73+
xcrun notarytool submit "$DMG_FILE" \
74+
--key ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }} \
75+
--key-id ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY_ID }} \
76+
--issuer ${{ secrets.GODOT_MACOS_NOTARIZATION_API_UUID }} \
77+
--output notarize_output.json --wait --timeout 20m
78+
79+
# This command automatically does the upload and waits up to 20 minutes.
80+
# If you prefer a two-step process, omit "--wait" here and do a separate "wait" step.
81+
82+
- name: Staple notarization
83+
if: matrix.os == 'macos-latest'
84+
run: |
85+
DMG_FILE=$(ls dist/*-x64.dmg | head -n 1)
86+
if [ -z "$DMG_FILE" ]; then
87+
echo "No x64 DMG found to staple!"
88+
exit 1
89+
fi
90+
echo "Stapling $DMG_FILE..."
91+
xcrun stapler staple "$DMG_FILE"
6592
6693
# ---------------------------------
6794
# Windows Build
@@ -89,7 +116,7 @@ jobs:
89116
ls -la dist/
90117
91118
# ---------------------------------
92-
# Upload Artifacts (Same as before)
119+
# Upload Artifacts
93120
# ---------------------------------
94121
- name: Check Linux build output
95122
if: matrix.os == 'ubuntu-latest-large'
@@ -126,7 +153,7 @@ jobs:
126153
if-no-files-found: error
127154

128155
# -------------------------------------
129-
# (Optional) Separate upload-to-releases job
156+
# Separate upload-to-releases job
130157
# -------------------------------------
131158
upload-to-releases:
132159
name: Upload to releases.drivechain.info

0 commit comments

Comments
 (0)