Skip to content

Commit 6adfcbf

Browse files
add notarization step
1 parent 1fb8a3d commit 6adfcbf

File tree

2 files changed

+221
-121
lines changed

2 files changed

+221
-121
lines changed

.github/workflows/build.yml

+57-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,70 @@ 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: Print environment for debugging
41+
if: matrix.os == 'macos-latest'
42+
run: printenv | sort
43+
- name: Build Electron app (macOS)
44+
if: matrix.os == 'macos-latest'
4045
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 }}
46+
# Force-disable any Apple ID environment variables:
47+
APPLE_ID: ""
48+
APPLE_ID_PASSWORD: ""
49+
ALTOOL_PASSWORD: ""
50+
NOTARIZE_APPLE_ID: ""
51+
NOTARIZE_APPLE_PASSWORD: ""
52+
53+
# Actually use the Apple API key approach:
54+
APPLE_API_KEY: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }}
55+
APPLE_API_KEY_ID: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY_ID }}
56+
APPLE_API_ISSUER: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_UUID }}
57+
58+
# Developer ID certificate & password for code signing:
4859
CSC_LINK: ${{ secrets.MACOS_CERTIFICATE }}
4960
CSC_KEY_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
61+
62+
# If your package.json notarize block references teamId:
63+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
64+
65+
# Debug logging for electron-builder
66+
DEBUG: electron-builder
67+
68+
# GitHub token (only if needed for publishing)
69+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
5071
run: npm run electron-build
5172

73+
# ---------------------------------
74+
# Windows Build
75+
# ---------------------------------
76+
- name: Build Electron app (Windows)
77+
if: matrix.os == 'windows-latest'
78+
env:
79+
DEBUG: electron-builder
80+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
run: npm run electron-build
82+
83+
# ---------------------------------
84+
# Linux Build
85+
# ---------------------------------
5286
- name: Build Electron app (Linux)
5387
if: matrix.os == 'ubuntu-latest-large'
5488
env:
5589
DEBUG: electron-builder
5690
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5791
run: |
58-
# Show electron-builder version
5992
npx electron-builder --version
60-
61-
# List contents before build
6293
ls -la
63-
64-
# Run build with verbose logging
6594
npx electron-builder --linux AppImage --x64
66-
67-
# Show build output directory
6895
echo "Build output directory contents:"
6996
ls -la dist/
7097
71-
# Upload artifacts based on platform
98+
# ---------------------------------
99+
# Upload Artifacts (Same as before)
100+
# ---------------------------------
72101
- name: Check Linux build output
73102
if: matrix.os == 'ubuntu-latest-large'
74103
run: |
@@ -78,34 +107,34 @@ jobs:
78107
exit 1
79108
fi
80109
find dist -type f -name "*.AppImage" || echo "No AppImage files found in dist/"
81-
110+
82111
- name: Upload Linux artifacts
83112
if: matrix.os == 'ubuntu-latest-large'
84113
uses: actions/upload-artifact@v4
85114
with:
86115
name: linux-build
87-
path: |
88-
dist/*.AppImage
116+
path: dist/*.AppImage
89117
if-no-files-found: error
90118

91119
- name: Upload Windows artifacts
92120
if: matrix.os == 'windows-latest'
93121
uses: actions/upload-artifact@v4
94122
with:
95123
name: windows-build
96-
path: |
97-
dist/*.exe
124+
path: dist/*.exe
98125
if-no-files-found: error
99126

100127
- name: Upload macOS artifacts
101128
if: matrix.os == 'macos-latest'
102129
uses: actions/upload-artifact@v4
103130
with:
104131
name: macos-build
105-
path: |
106-
dist/*.dmg
132+
path: dist/*.dmg
107133
if-no-files-found: error
108134

135+
# -------------------------------------
136+
# (Optional) Separate upload-to-releases job
137+
# -------------------------------------
109138
upload-to-releases:
110139
name: Upload to releases.drivechain.info
111140
runs-on: ubuntu-latest
@@ -131,42 +160,30 @@ jobs:
131160
132161
- name: Process artifacts
133162
run: |
134-
# Process Linux artifact
163+
# Linux
135164
cd artifacts/linux-build
136165
mv *.AppImage ../../drivechain-launcher-latest-x86_64-linux.AppImage
137166
cd ../..
138167
139-
# Process Windows artifact
168+
# Windows
140169
cd artifacts/windows-build
141-
echo "Windows build directory contents before processing:"
142-
ls -la
143-
144-
# Find the exact exe file
145170
EXE_FILE=$(ls Drivechain-Launcher-Setup-*.exe 2>/dev/null || echo "")
146171
if [ -z "$EXE_FILE" ]; then
147172
echo "Error: No Windows exe file found"
148173
exit 1
149174
fi
150-
echo "Found Windows exe file: $EXE_FILE"
151-
152-
# Create zip file containing the exe
153175
zip ../../drivechain-launcher-latest-windows.zip "$EXE_FILE"
154176
cd ../..
155177
156-
# Process macOS artifacts
178+
# macOS
157179
cd artifacts/macos-build
158-
echo "macOS build directory contents before processing:"
159-
ls -la
160-
161-
# Process arm64 DMG
162180
ARM64_DMG=$(ls *-arm64.dmg 2>/dev/null || echo "")
163181
if [ -z "$ARM64_DMG" ]; then
164182
echo "Error: No arm64 DMG file found"
165183
exit 1
166184
fi
167185
mv "$ARM64_DMG" ../../drivechain-launcher-latest-osx-arm64.dmg
168186
169-
# Process x64 DMG
170187
X64_DMG=$(ls *-x64.dmg 2>/dev/null || echo "")
171188
if [ -z "$X64_DMG" ]; then
172189
echo "Error: No x64 DMG file found"

0 commit comments

Comments
 (0)