Skip to content

Commit 0a847ab

Browse files
add notarization step
1 parent 1fb8a3d commit 0a847ab

File tree

1 file changed

+54
-40
lines changed

1 file changed

+54
-40
lines changed

.github/workflows/build.yml

+54-40
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ on:
1212
jobs:
1313
build:
1414
runs-on: ${{ matrix.os }}
15-
1615
strategy:
1716
matrix:
1817
os: [ubuntu-latest-large, windows-latest, macos-latest]
@@ -35,40 +34,67 @@ jobs:
3534
CI: false
3635
run: npm run react-build
3736

38-
- name: Build Electron app
39-
if: matrix.os != 'ubuntu-latest-large'
37+
# ---------------------------------
38+
# macOS Build & Notarization (API Key)
39+
# ---------------------------------
40+
- name: Build Electron app (macOS)
41+
if: matrix.os == 'macos-latest'
4042
env:
41-
DEBUG: electron-builder
42-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
# macOS signing environment variables
44-
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
45-
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
46-
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
47-
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
43+
# Force-disable any Apple ID environment variables:
44+
APPLE_ID: ""
45+
APPLE_ID_PASSWORD: ""
46+
ALTOOL_PASSWORD: ""
47+
NOTARIZE_APPLE_ID: ""
48+
NOTARIZE_APPLE_PASSWORD: ""
49+
50+
# Actually use the Apple API key approach:
51+
APPLE_API_KEY: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }}
52+
APPLE_API_KEY_ID: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY_ID }}
53+
APPLE_API_ISSUER: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_UUID }}
54+
55+
# Developer ID certificate & password for code signing:
4856
CSC_LINK: ${{ secrets.MACOS_CERTIFICATE }}
4957
CSC_KEY_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
58+
59+
# If your package.json notarize block references teamId:
60+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
61+
62+
# Debug logging for electron-builder
63+
DEBUG: electron-builder
64+
65+
# GitHub token (only if needed for publishing)
66+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
68+
run: npm run electron-build
69+
70+
# ---------------------------------
71+
# Windows Build
72+
# ---------------------------------
73+
- name: Build Electron app (Windows)
74+
if: matrix.os == 'windows-latest'
75+
env:
76+
DEBUG: electron-builder
77+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5078
run: npm run electron-build
5179

80+
# ---------------------------------
81+
# Linux Build
82+
# ---------------------------------
5283
- name: Build Electron app (Linux)
5384
if: matrix.os == 'ubuntu-latest-large'
5485
env:
5586
DEBUG: electron-builder
5687
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5788
run: |
58-
# Show electron-builder version
5989
npx electron-builder --version
60-
61-
# List contents before build
6290
ls -la
63-
64-
# Run build with verbose logging
6591
npx electron-builder --linux AppImage --x64
66-
67-
# Show build output directory
6892
echo "Build output directory contents:"
6993
ls -la dist/
7094
71-
# Upload artifacts based on platform
95+
# ---------------------------------
96+
# Upload Artifacts (Same as before)
97+
# ---------------------------------
7298
- name: Check Linux build output
7399
if: matrix.os == 'ubuntu-latest-large'
74100
run: |
@@ -78,34 +104,34 @@ jobs:
78104
exit 1
79105
fi
80106
find dist -type f -name "*.AppImage" || echo "No AppImage files found in dist/"
81-
107+
82108
- name: Upload Linux artifacts
83109
if: matrix.os == 'ubuntu-latest-large'
84110
uses: actions/upload-artifact@v4
85111
with:
86112
name: linux-build
87-
path: |
88-
dist/*.AppImage
113+
path: dist/*.AppImage
89114
if-no-files-found: error
90115

91116
- name: Upload Windows artifacts
92117
if: matrix.os == 'windows-latest'
93118
uses: actions/upload-artifact@v4
94119
with:
95120
name: windows-build
96-
path: |
97-
dist/*.exe
121+
path: dist/*.exe
98122
if-no-files-found: error
99123

100124
- name: Upload macOS artifacts
101125
if: matrix.os == 'macos-latest'
102126
uses: actions/upload-artifact@v4
103127
with:
104128
name: macos-build
105-
path: |
106-
dist/*.dmg
129+
path: dist/*.dmg
107130
if-no-files-found: error
108131

132+
# -------------------------------------
133+
# (Optional) Separate upload-to-releases job
134+
# -------------------------------------
109135
upload-to-releases:
110136
name: Upload to releases.drivechain.info
111137
runs-on: ubuntu-latest
@@ -131,42 +157,30 @@ jobs:
131157
132158
- name: Process artifacts
133159
run: |
134-
# Process Linux artifact
160+
# Linux
135161
cd artifacts/linux-build
136162
mv *.AppImage ../../drivechain-launcher-latest-x86_64-linux.AppImage
137163
cd ../..
138164
139-
# Process Windows artifact
165+
# Windows
140166
cd artifacts/windows-build
141-
echo "Windows build directory contents before processing:"
142-
ls -la
143-
144-
# Find the exact exe file
145167
EXE_FILE=$(ls Drivechain-Launcher-Setup-*.exe 2>/dev/null || echo "")
146168
if [ -z "$EXE_FILE" ]; then
147169
echo "Error: No Windows exe file found"
148170
exit 1
149171
fi
150-
echo "Found Windows exe file: $EXE_FILE"
151-
152-
# Create zip file containing the exe
153172
zip ../../drivechain-launcher-latest-windows.zip "$EXE_FILE"
154173
cd ../..
155174
156-
# Process macOS artifacts
175+
# macOS
157176
cd artifacts/macos-build
158-
echo "macOS build directory contents before processing:"
159-
ls -la
160-
161-
# Process arm64 DMG
162177
ARM64_DMG=$(ls *-arm64.dmg 2>/dev/null || echo "")
163178
if [ -z "$ARM64_DMG" ]; then
164179
echo "Error: No arm64 DMG file found"
165180
exit 1
166181
fi
167182
mv "$ARM64_DMG" ../../drivechain-launcher-latest-osx-arm64.dmg
168183
169-
# Process x64 DMG
170184
X64_DMG=$(ls *-x64.dmg 2>/dev/null || echo "")
171185
if [ -z "$X64_DMG" ]; then
172186
echo "Error: No x64 DMG file found"

0 commit comments

Comments
 (0)