mirror of
https://git.sanhost.net/sanasol/hytale-f2p
synced 2026-02-26 18:41:48 -03:00
Compare commits
8 Commits
hotfix/mac
...
sanasol-fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0831b3b83 | ||
|
|
5cf9fa3af4 | ||
|
|
ee4909cc72 | ||
|
|
9d63e6e971 | ||
|
|
153868fb87 | ||
|
|
743d7f2b7c | ||
|
|
759a7089c4 | ||
|
|
0a5cc3f6d7 |
146
.github/workflows/release.yml
vendored
146
.github/workflows/release.yml
vendored
@@ -27,9 +27,9 @@ jobs:
|
|||||||
dist/*.exe.blockmap
|
dist/*.exe.blockmap
|
||||||
dist/latest.yml
|
dist/latest.yml
|
||||||
|
|
||||||
# macOS ARM64 build (Apple Silicon)
|
# macOS Universal build (ARM64 + x64 in single binary)
|
||||||
build-macos-arm64:
|
build-macos:
|
||||||
runs-on: macos-14 # M1 runner for native ARM64 builds
|
runs-on: macos-latest
|
||||||
timeout-minutes: 120
|
timeout-minutes: 120
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -39,75 +39,28 @@ jobs:
|
|||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|
||||||
- name: Build macOS ARM64 Package
|
- name: Build macOS Universal Package
|
||||||
env:
|
env:
|
||||||
# Code signing
|
# Code signing
|
||||||
CSC_LINK: ${{ secrets.CSC_LINK }}
|
CSC_LINK: ${{ secrets.CSC_LINK }}
|
||||||
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
||||||
# Notarization
|
# Notarization (built-in electron-builder)
|
||||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||||
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
|
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
|
||||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||||
run: npx electron-builder --mac --arm64 --publish never
|
run: npx electron-builder --mac --universal --publish never
|
||||||
|
|
||||||
- name: Rename ARM64 artifacts for clarity
|
- name: List built artifacts
|
||||||
run: |
|
run: ls -la dist/
|
||||||
cd dist
|
|
||||||
for f in *.dmg; do
|
|
||||||
[ -f "$f" ] && mv "$f" "${f%.dmg}-arm64.dmg" 2>/dev/null || true
|
|
||||||
done
|
|
||||||
for f in *.zip; do
|
|
||||||
[ -f "$f" ] && mv "$f" "${f%.zip}-arm64.zip" 2>/dev/null || true
|
|
||||||
done
|
|
||||||
ls -la
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: macos-arm64-builds
|
name: macos-builds
|
||||||
path: |
|
|
||||||
dist/*.dmg
|
|
||||||
dist/*.zip
|
|
||||||
|
|
||||||
# macOS x64 build (Intel)
|
|
||||||
build-macos-x64:
|
|
||||||
runs-on: macos-13 # Intel runner for native x64 builds
|
|
||||||
timeout-minutes: 120
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '22'
|
|
||||||
cache: 'npm'
|
|
||||||
- run: npm ci
|
|
||||||
|
|
||||||
- name: Build macOS x64 Package
|
|
||||||
env:
|
|
||||||
# Code signing
|
|
||||||
CSC_LINK: ${{ secrets.CSC_LINK }}
|
|
||||||
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
|
||||||
# Notarization
|
|
||||||
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 --x64 --publish never
|
|
||||||
|
|
||||||
- name: Rename x64 artifacts for clarity
|
|
||||||
run: |
|
|
||||||
cd dist
|
|
||||||
for f in *.dmg; do
|
|
||||||
[ -f "$f" ] && mv "$f" "${f%.dmg}-x64.dmg" 2>/dev/null || true
|
|
||||||
done
|
|
||||||
for f in *.zip; do
|
|
||||||
[ -f "$f" ] && mv "$f" "${f%.zip}-x64.zip" 2>/dev/null || true
|
|
||||||
done
|
|
||||||
ls -la
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: macos-x64-builds
|
|
||||||
path: |
|
path: |
|
||||||
dist/*.dmg
|
dist/*.dmg
|
||||||
dist/*.zip
|
dist/*.zip
|
||||||
|
dist/*.blockmap
|
||||||
|
dist/latest-mac.yml
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -168,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()
|
||||||
@@ -188,9 +141,9 @@ jobs:
|
|||||||
.SRCINFO
|
.SRCINFO
|
||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
|
|
||||||
# Create release with Windows, Linux, Arch (fast builds)
|
# Create release with all builds
|
||||||
release:
|
release:
|
||||||
needs: [build-windows, 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') ||
|
||||||
@@ -222,6 +175,12 @@ jobs:
|
|||||||
name: arch-package
|
name: arch-package
|
||||||
path: artifacts/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
|
||||||
|
|
||||||
@@ -239,68 +198,7 @@ jobs:
|
|||||||
artifacts/arch-package/.SRCINFO
|
artifacts/arch-package/.SRCINFO
|
||||||
artifacts/linux-builds/*
|
artifacts/linux-builds/*
|
||||||
artifacts/windows-builds/*
|
artifacts/windows-builds/*
|
||||||
|
artifacts/macos-builds/*
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
||||||
# Upload macOS ARM64 builds separately
|
|
||||||
release-macos-arm64:
|
|
||||||
needs: [build-macos-arm64, 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 ARM64 artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: macos-arm64-builds
|
|
||||||
path: artifacts/macos-arm64-builds
|
|
||||||
|
|
||||||
- name: Display macOS ARM64 files
|
|
||||||
run: ls -R artifacts
|
|
||||||
|
|
||||||
- name: Upload macOS ARM64 to Release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
tag_name: ${{ github.ref_name }}
|
|
||||||
files: |
|
|
||||||
artifacts/macos-arm64-builds/*
|
|
||||||
draft: true
|
|
||||||
prerelease: false
|
|
||||||
|
|
||||||
# Upload macOS x64 builds separately
|
|
||||||
release-macos-x64:
|
|
||||||
needs: [build-macos-x64, 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 x64 artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: macos-x64-builds
|
|
||||||
path: artifacts/macos-x64-builds
|
|
||||||
|
|
||||||
- name: Display macOS x64 files
|
|
||||||
run: ls -R artifacts
|
|
||||||
|
|
||||||
- name: Upload macOS x64 to Release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
tag_name: ${{ github.ref_name }}
|
|
||||||
files: |
|
|
||||||
artifacts/macos-x64-builds/*
|
|
||||||
draft: true
|
|
||||||
prerelease: false
|
|
||||||
|
|||||||
13
package.json
13
package.json
@@ -121,15 +121,13 @@
|
|||||||
{
|
{
|
||||||
"target": "dmg",
|
"target": "dmg",
|
||||||
"arch": [
|
"arch": [
|
||||||
"arm64",
|
"universal"
|
||||||
"x64"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"target": "zip",
|
"target": "zip",
|
||||||
"arch": [
|
"arch": [
|
||||||
"arm64",
|
"universal"
|
||||||
"x64"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -138,9 +136,12 @@
|
|||||||
"hardenedRuntime": true,
|
"hardenedRuntime": true,
|
||||||
"gatekeeperAssess": false,
|
"gatekeeperAssess": false,
|
||||||
"entitlements": "build/entitlements.mac.plist",
|
"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": {
|
"nsis": {
|
||||||
"oneClick": false,
|
"oneClick": false,
|
||||||
"allowToChangeInstallationDirectory": true,
|
"allowToChangeInstallationDirectory": true,
|
||||||
|
|||||||
@@ -11,6 +11,18 @@ try {
|
|||||||
|
|
||||||
const path = require('path');
|
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) {
|
exports.default = async function notarizing(context) {
|
||||||
console.log('[Notarize] afterSign hook called');
|
console.log('[Notarize] afterSign hook called');
|
||||||
console.log('[Notarize] Context:', JSON.stringify({
|
console.log('[Notarize] Context:', JSON.stringify({
|
||||||
@@ -27,6 +39,12 @@ exports.default = async function notarizing(context) {
|
|||||||
return;
|
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
|
// Check credentials
|
||||||
const hasAppleId = !!process.env.APPLE_ID;
|
const hasAppleId = !!process.env.APPLE_ID;
|
||||||
const hasPassword = !!process.env.APPLE_APP_SPECIFIC_PASSWORD;
|
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] Starting notarization...');
|
||||||
console.log('[Notarize] App path:', appPath);
|
console.log('[Notarize] App path:', appPath);
|
||||||
console.log('[Notarize] Team ID:', process.env.APPLE_TEAM_ID);
|
console.log('[Notarize] Team ID:', process.env.APPLE_TEAM_ID);
|
||||||
|
console.log('[Notarize] Timeout:', NOTARIZE_TIMEOUT_MS / 1000, 'seconds');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await notarize({
|
await withTimeout(
|
||||||
appPath,
|
notarize({
|
||||||
appleId: process.env.APPLE_ID,
|
appPath,
|
||||||
appleIdPassword: process.env.APPLE_APP_SPECIFIC_PASSWORD,
|
appleId: process.env.APPLE_ID,
|
||||||
teamId: process.env.APPLE_TEAM_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!');
|
console.log('[Notarize] Notarization complete!');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[Notarize] Notarization failed:', error.message);
|
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;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user