Compare commits

...

8 Commits

Author SHA1 Message Date
sanasol
d0831b3b83 fix(ci): use APPLE_APP_SPECIFIC_PASSWORD for notarization 2026-02-03 03:03:51 +01:00
sanasol
5cf9fa3af4 fix(ci): switch to built-in electron-builder notarization
- Remove custom afterSign hook (scripts/notarize.js)
- Enable built-in notarization with "notarize": true
- Use APPLE_ID_PASSWORD env var for electron-builder
- Restore full build (dmg + zip) to test blockmap

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 03:00:30 +01:00
sanasol
ee4909cc72 fix(ci): build only DMG for macOS to avoid blockmap hang
- Skip zip target, only build DMG
- Blockmap generation for universal+zip was hanging indefinitely
- DMG alone should complete faster

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 02:49:36 +01:00
sanasol
9d63e6e971 fix(ci): revert to universal macOS build with single notarization
- Replace separate ARM64 and x64 builds with single universal build
- Use --universal flag for fat binary (both archs in one app)
- Update package.json mac target to use "universal" arch
- Single notarization instead of double (fixes duplicate notarize calls)
- Simplify workflow by removing separate macOS release jobs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 02:28:11 +01:00
sanasol
153868fb87 fix(macos): improve notarization with timeout and graceful failure
Changes:
- Add 30 minute timeout for notarization (fail fast)
- Add SKIP_NOTARIZE=true env var to skip notarization entirely
- Don't fail build if notarization fails (app still code-signed)
- Add NOTARIZE_FAIL_ON_ERROR=true to fail build on notarization error
- Add forceCodeSigning, strictVerify, type=distribution to mac config
- Disable electron-builder built-in notarize (using custom script)

This prevents CI from hanging forever waiting for Apple's notarization
service and reduces wasted GitHub Actions minutes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 03:00:47 +01:00
sanasol
743d7f2b7c fix(ci): use macos-latest for ARM64 builds 2026-01-31 20:02:07 +01:00
sanasol
759a7089c4 fix(ci): use macos-15-large for Intel x64 builds (macos-13 retired) 2026-01-31 20:00:13 +01:00
sanasol
0a5cc3f6d7 feat(ci): separate macOS arm64 and x64 builds with individual code signing
Changes:
- Split macOS build into two separate jobs: build-macos-arm64 and build-macos-x64
- ARM64 builds on macos-14 (M1 runner) for native Apple Silicon builds
- x64 builds on macos-13 (Intel runner) for native Intel builds
- Each build has its own code signing and notarization process
- Artifacts renamed with -arm64 and -x64 suffixes for clarity
- Separate release jobs for each architecture
- Updated package.json mac targets from "universal" to ["arm64", "x64"]

This fixes code signing issues when building universal binaries and allows
faster parallel builds for each architecture.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:58:35 +01:00
3 changed files with 63 additions and 48 deletions

View File

@@ -27,9 +27,10 @@ jobs:
dist/*.exe.blockmap
dist/latest.yml
# macOS Universal build (ARM64 + x64 in single binary)
build-macos:
runs-on: macos-latest
timeout-minutes: 360 # Max allowed (6 hours) for notarization
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
@@ -38,22 +39,27 @@ jobs:
cache: 'npm'
- run: npm ci
- name: Build macOS Packages
- name: Build macOS Universal Package
env:
# Code signing
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
# Notarization
# Notarization (built-in electron-builder)
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: npx electron-builder --mac --publish never
run: npx electron-builder --mac --universal --publish never
- name: List built artifacts
run: ls -la dist/
- uses: actions/upload-artifact@v4
with:
name: macos-builds
path: |
dist/*.dmg
dist/*.zip
dist/*.blockmap
dist/latest-mac.yml
build-linux:
@@ -115,11 +121,11 @@ jobs:
- name: Build Arch Package
run: |
sudo -u builder bash << 'EOF'
sudo -u builder bash << 'EOFBUILD'
set -e
makepkg --printsrcinfo > .SRCINFO
makepkg -s --noconfirm
EOF
EOFBUILD
- name: Fix permissions for upload
if: always()
@@ -135,9 +141,9 @@ jobs:
.SRCINFO
include-hidden-files: true
# Create release with Windows, Linux, Arch (fast builds)
# Create release with all builds
release:
needs: [build-windows, build-linux, build-arch]
needs: [build-windows, build-linux, build-arch, build-macos]
runs-on: ubuntu-latest
if: |
startsWith(github.ref, 'refs/tags/v') ||
@@ -169,6 +175,12 @@ jobs:
name: arch-package
path: artifacts/arch-package
- name: Download macOS artifacts
uses: actions/download-artifact@v4
with:
name: macos-builds
path: artifacts/macos-builds
- name: Display structure of downloaded files
run: ls -R artifacts
@@ -186,37 +198,7 @@ jobs:
artifacts/arch-package/.SRCINFO
artifacts/linux-builds/*
artifacts/windows-builds/*
artifacts/macos-builds/*
generate_release_notes: true
draft: true
prerelease: false
# Upload macOS builds separately (slow due to notarization)
release-macos:
needs: [build-macos, release]
runs-on: ubuntu-latest
if: |
startsWith(github.ref, 'refs/tags/v') ||
github.ref == 'refs/heads/main' ||
github.event_name == 'workflow_dispatch'
permissions:
contents: write
steps:
- name: Download macOS artifacts
uses: actions/download-artifact@v4
with:
name: macos-builds
path: artifacts/macos-builds
- name: Display macOS files
run: ls -R artifacts
- name: Upload macOS to Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: |
artifacts/macos-builds/*
draft: true
prerelease: false

View File

@@ -136,9 +136,12 @@
"hardenedRuntime": true,
"gatekeeperAssess": false,
"entitlements": "build/entitlements.mac.plist",
"entitlementsInherit": "build/entitlements.mac.plist"
"entitlementsInherit": "build/entitlements.mac.plist",
"forceCodeSigning": true,
"strictVerify": true,
"type": "distribution",
"notarize": true
},
"afterSign": "scripts/notarize.js",
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true,

View File

@@ -11,6 +11,18 @@ try {
const path = require('path');
// Timeout for notarization (30 minutes max)
const NOTARIZE_TIMEOUT_MS = 30 * 60 * 1000;
function withTimeout(promise, ms, message) {
return Promise.race([
promise,
new Promise((_, reject) =>
setTimeout(() => reject(new Error(message)), ms)
)
]);
}
exports.default = async function notarizing(context) {
console.log('[Notarize] afterSign hook called');
console.log('[Notarize] Context:', JSON.stringify({
@@ -27,6 +39,12 @@ exports.default = async function notarizing(context) {
return;
}
// Check if notarization is disabled via env var
if (process.env.SKIP_NOTARIZE === 'true') {
console.log('[Notarize] Skipping: SKIP_NOTARIZE=true');
return;
}
// Check credentials
const hasAppleId = !!process.env.APPLE_ID;
const hasPassword = !!process.env.APPLE_APP_SPECIFIC_PASSWORD;
@@ -45,18 +63,30 @@ exports.default = async function notarizing(context) {
console.log('[Notarize] Starting notarization...');
console.log('[Notarize] App path:', appPath);
console.log('[Notarize] Team ID:', process.env.APPLE_TEAM_ID);
console.log('[Notarize] Timeout:', NOTARIZE_TIMEOUT_MS / 1000, 'seconds');
try {
await notarize({
await withTimeout(
notarize({
appPath,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_APP_SPECIFIC_PASSWORD,
teamId: process.env.APPLE_TEAM_ID,
});
}),
NOTARIZE_TIMEOUT_MS,
`Notarization timed out after ${NOTARIZE_TIMEOUT_MS / 1000} seconds`
);
console.log('[Notarize] Notarization complete!');
} catch (error) {
console.error('[Notarize] Notarization failed:', error.message);
console.error('[Notarize] Full error:', error);
// Don't fail the build if notarization times out or fails
// The app will still be code-signed, just not notarized
if (process.env.NOTARIZE_FAIL_ON_ERROR !== 'true') {
console.warn('[Notarize] Continuing build without notarization (set NOTARIZE_FAIL_ON_ERROR=true to fail)');
return;
}
throw error;
}
};