Compare commits

...

14 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
sanasol
499d9a5a6d Merge sanasol/develop into develop 2026-01-31 19:54:46 +01:00
sanasol
dfe9ed2a89 ci: set 6-hour max timeout for macOS notarization
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 20:59:28 +01:00
sanasol
0aaf74a3db fix: add verbose logging to notarize script for debugging
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 15:14:59 +01:00
sanasol
be78f67439 chore: update package-lock.json
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 15:04:13 +01:00
sanasol
d0b9ae1da8 ci: separate macOS release from main release job
macOS notarization is slow (5-10 min). Now release is created
immediately when Windows/Linux/Arch complete, and macOS uploads
to the same release when notarization finishes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 15:01:57 +01:00
sanasol
e8105cb30e feat: add macOS code signing and notarization support
- Add entitlements.mac.plist for hardened runtime
- Add notarize.js post-sign hook for Apple notarization
- Update package.json with signing config and @electron/notarize dep
- Update GitHub Actions workflow with signing secrets

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:48:40 +01:00
5 changed files with 653 additions and 266 deletions

View File

@@ -16,7 +16,7 @@ jobs:
node-version: '22' node-version: '22'
cache: 'npm' cache: 'npm'
- run: npm ci - run: npm ci
- name: Build Windows Packages - name: Build Windows Packages
run: npx electron-builder --win --publish never run: npx electron-builder --win --publish never
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
@@ -27,8 +27,10 @@ jobs:
dist/*.exe.blockmap dist/*.exe.blockmap
dist/latest.yml dist/latest.yml
# macOS Universal build (ARM64 + x64 in single binary)
build-macos: build-macos:
runs-on: macos-latest runs-on: macos-latest
timeout-minutes: 120
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
@@ -37,14 +39,27 @@ jobs:
cache: 'npm' cache: 'npm'
- run: npm ci - run: npm ci
- name: Build macOS Packages - name: Build macOS Universal Package
run: npx electron-builder --mac --publish never env:
# Code signing
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
# 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 --universal --publish never
- name: List built artifacts
run: ls -la dist/
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
name: macos-builds name: macos-builds
path: | path: |
dist/*.dmg dist/*.dmg
dist/*.zip dist/*.zip
dist/*.blockmap
dist/latest-mac.yml dist/latest-mac.yml
build-linux: build-linux:
@@ -55,7 +70,7 @@ jobs:
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y libarchive-tools sudo apt-get install -y libarchive-tools
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: '22' node-version: '22'
@@ -84,7 +99,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Install base packages - name: Install base packages
run: | run: |
pacman -Syu --noconfirm pacman -Syu --noconfirm
@@ -106,11 +121,11 @@ jobs:
- name: Build Arch Package - name: Build Arch Package
run: | run: |
sudo -u builder bash << 'EOF' sudo -u builder bash << 'EOFBUILD'
set -e set -e
makepkg --printsrcinfo > .SRCINFO makepkg --printsrcinfo > .SRCINFO
makepkg -s --noconfirm makepkg -s --noconfirm
EOF EOFBUILD
- name: Fix permissions for upload - name: Fix permissions for upload
if: always() if: always()
@@ -126,12 +141,13 @@ jobs:
.SRCINFO .SRCINFO
include-hidden-files: true include-hidden-files: true
# Create release with all builds
release: release:
needs: [build-windows, build-macos, build-linux, build-arch] needs: [build-windows, build-linux, build-arch, build-macos]
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: | if: |
startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/v') ||
github.ref == 'refs/heads/main' || github.ref == 'refs/heads/main' ||
github.event_name == 'workflow_dispatch' github.event_name == 'workflow_dispatch'
permissions: permissions:
@@ -141,10 +157,29 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Download all artifacts - name: Download Windows artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
path: artifacts name: windows-builds
path: artifacts/windows-builds
- name: Download Linux artifacts
uses: actions/download-artifact@v4
with:
name: linux-builds
path: artifacts/linux-builds
- name: Download Arch artifacts
uses: actions/download-artifact@v4
with:
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 - name: Display structure of downloaded files
run: ls -R artifacts run: ls -R artifacts
@@ -161,10 +196,9 @@ jobs:
artifacts/arch-package/*.pkg.tar.zst artifacts/arch-package/*.pkg.tar.zst
artifacts/arch-package/*.src.tar.zst artifacts/arch-package/*.src.tar.zst
artifacts/arch-package/.SRCINFO artifacts/arch-package/.SRCINFO
artifacts/linux-builds/**/* artifacts/linux-builds/*
artifacts/windows-builds/**/* artifacts/windows-builds/*
artifacts/macos-builds/**/* artifacts/macos-builds/*
generate_release_notes: true generate_release_notes: true
draft: true draft: true
prerelease: false prerelease: false

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
</dict>
</plist>

683
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "hytale-f2p-launcher", "name": "hytale-f2p-launcher",
"version": "2.2.0", "version": "2.1.2",
"description": "A modern, cross-platform launcher for Hytale with automatic updates and multi-client support", "description": "A modern, cross-platform launcher for Hytale with automatic updates and multi-client support",
"homepage": "https://github.com/amiayweb/Hytale-F2P", "homepage": "https://github.com/amiayweb/Hytale-F2P",
"main": "main.js", "main": "main.js",
@@ -25,7 +25,8 @@
"cross-platform", "cross-platform",
"electron", "electron",
"auto-update", "auto-update",
"mod-manager" "mod-manager",
"chat"
], ],
"maintainers": [ "maintainers": [
{ {
@@ -33,7 +34,7 @@
"url": "https://github.com/Terromur" "url": "https://github.com/Terromur"
}, },
{ {
"name": "Fazri Gading", "name": "Fari Gading",
"email": "fazrigading@gmail.com", "email": "fazrigading@gmail.com",
"url": "https://github.com/fazrigading" "url": "https://github.com/fazrigading"
} }
@@ -44,6 +45,7 @@
}, },
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@electron/notarize": "^2.5.0",
"electron": "^40.0.0", "electron": "^40.0.0",
"electron-builder": "^26.4.0" "electron-builder": "^26.4.0"
}, },
@@ -54,13 +56,16 @@
"dotenv": "^17.2.3", "dotenv": "^17.2.3",
"electron-updater": "^6.7.3", "electron-updater": "^6.7.3",
"fs-extra": "^11.3.3", "fs-extra": "^11.3.3",
"tar": "^7.5.7", "tar": "^6.2.1",
"uuid": "^9.0.1" "uuid": "^9.0.1"
}, },
"overrides": {
"tar": "$tar"
},
"build": { "build": {
"appId": "com.hytalef2p.launcher", "appId": "com.hytalef2p.launcher",
"productName": "Hytale F2P Launcher", "productName": "Hytale F2P Launcher",
"artifactName": "${name}_${version}.${ext}", "artifactName": "${name}_${version}_${arch}.${ext}",
"directories": { "directories": {
"output": "dist" "output": "dist"
}, },
@@ -73,14 +78,40 @@
".env" ".env"
], ],
"win": { "win": {
"target": "nsis", "target": [
{
"target": "nsis",
"arch": [
"x64",
"arm64"
]
}
],
"icon": "build/icon.ico" "icon": "build/icon.ico"
}, },
"linux": { "linux": {
"target": [ "target": [
"AppImage", {
"deb", "target": "AppImage",
"rpm" "arch": [
"x64",
"arm64"
]
},
{
"target": "deb",
"arch": [
"x64",
"arm64"
]
},
{
"target": "rpm",
"arch": [
"x64",
"arm64"
]
}
], ],
"icon": "build/icon.png", "icon": "build/icon.png",
"category": "Game" "category": "Game"
@@ -101,8 +132,15 @@
} }
], ],
"icon": "build/icon.icns", "icon": "build/icon.icns",
"artifactName": "${name}_${version}_${arch}.${ext}", "category": "public.app-category.games",
"category": "public.app-category.games" "hardenedRuntime": true,
"gatekeeperAssess": false,
"entitlements": "build/entitlements.mac.plist",
"entitlementsInherit": "build/entitlements.mac.plist",
"forceCodeSigning": true,
"strictVerify": true,
"type": "distribution",
"notarize": true
}, },
"nsis": { "nsis": {
"oneClick": false, "oneClick": false,

92
scripts/notarize.js Normal file
View File

@@ -0,0 +1,92 @@
console.log('[Notarize] Script loaded');
let notarize;
try {
notarize = require('@electron/notarize').notarize;
console.log('[Notarize] @electron/notarize loaded successfully');
} catch (err) {
console.error('[Notarize] Failed to load @electron/notarize:', err.message);
throw err;
}
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({
platform: context.electronPlatformName,
appOutDir: context.appOutDir,
outDir: context.outDir
}, null, 2));
const { electronPlatformName, appOutDir } = context;
// Only notarize macOS builds
if (electronPlatformName !== 'darwin') {
console.log('[Notarize] Skipping: not macOS');
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;
const hasTeamId = !!process.env.APPLE_TEAM_ID;
console.log('[Notarize] Credentials check:', { hasAppleId, hasPassword, hasTeamId });
if (!hasAppleId || !hasPassword || !hasTeamId) {
console.log('[Notarize] Skipping: missing credentials');
return;
}
const appName = context.packager.appInfo.productFilename;
const appPath = path.join(appOutDir, `${appName}.app`);
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 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);
// 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;
}
};