fix: Improve macOS support
This commit is contained in:
47
.github/workflows/electron-build.yml
vendored
47
.github/workflows/electron-build.yml
vendored
@@ -94,51 +94,6 @@ jobs:
|
|||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
build-macos:
|
build-macos:
|
||||||
runs-on: macos-latest
|
|
||||||
if: github.event.inputs.build_type == 'all' || github.event.inputs.build_type == 'macos' || github.event.inputs.build_type == ''
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: "20"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
rm -f package-lock.json
|
|
||||||
npm install
|
|
||||||
npm install --force @rollup/rollup-darwin-arm64
|
|
||||||
|
|
||||||
- name: Build macOS DMG
|
|
||||||
run: npm run build:mac-dmg
|
|
||||||
env:
|
|
||||||
CSC_IDENTITY_AUTO_DISCOVERY: false
|
|
||||||
|
|
||||||
- name: Build macOS Zip
|
|
||||||
run: npm run build:mac-zip
|
|
||||||
env:
|
|
||||||
CSC_IDENTITY_AUTO_DISCOVERY: false
|
|
||||||
|
|
||||||
- name: Upload macOS DMG Artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: Termix-macOS-DMG
|
|
||||||
path: release/*.dmg
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- name: Upload macOS Zip Artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: Termix-macOS-Zip
|
|
||||||
path: release/*.zip
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
build-macos-mas:
|
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
if: github.event.inputs.build_type == 'macos' || github.event.inputs.build_type == 'all'
|
if: github.event.inputs.build_type == 'macos' || github.event.inputs.build_type == 'all'
|
||||||
needs: []
|
needs: []
|
||||||
@@ -191,7 +146,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build macOS App Store Package
|
- name: Build macOS App Store Package
|
||||||
if: steps.check_certs.outputs.has_certs == 'true'
|
if: steps.check_certs.outputs.has_certs == 'true'
|
||||||
run: npm run build:mac-mas
|
run: npm run build:mac
|
||||||
env:
|
env:
|
||||||
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 }}
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
<?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.cs.allow-dyld-environment-variables</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>
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
const { notarize } = require('@electron/notarize');
|
|
||||||
|
|
||||||
exports.default = async function notarizing(context) {
|
|
||||||
const { electronPlatformName, appOutDir, packager } = context;
|
|
||||||
|
|
||||||
// Skip notarization for non-macOS platforms
|
|
||||||
if (electronPlatformName !== 'darwin') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Skip notarization for Mac App Store builds (MAS)
|
|
||||||
// MAS builds are notarized by Apple during App Store review
|
|
||||||
const target = packager.platformSpecificBuildOptions.target || [];
|
|
||||||
const isMasBuild = Array.isArray(target)
|
|
||||||
? target.some(t => t.target === 'mas' || t === 'mas')
|
|
||||||
: target === 'mas';
|
|
||||||
|
|
||||||
if (isMasBuild || appOutDir.includes('mas')) {
|
|
||||||
console.log('Skipping notarization for Mac App Store build');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const appName = context.packager.appInfo.productFilename;
|
|
||||||
const appPath = `${appOutDir}/${appName}.app`;
|
|
||||||
|
|
||||||
const appleId = process.env.APPLE_ID;
|
|
||||||
const appleIdPassword = process.env.APPLE_APP_SPECIFIC_PASSWORD;
|
|
||||||
const teamId = process.env.APPLE_TEAM_ID;
|
|
||||||
|
|
||||||
// Skip if credentials not provided (for unsigned builds)
|
|
||||||
if (!appleId || !appleIdPassword || !teamId) {
|
|
||||||
console.log('Skipping notarization: credentials not provided');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('Starting notarization process...');
|
|
||||||
try {
|
|
||||||
await notarize({
|
|
||||||
appPath: appPath,
|
|
||||||
appleId: appleId,
|
|
||||||
appleIdPassword: appleIdPassword,
|
|
||||||
teamId: teamId,
|
|
||||||
});
|
|
||||||
console.log('Notarization completed successfully');
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Notarization failed:', error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -62,14 +62,6 @@
|
|||||||
},
|
},
|
||||||
"mac": {
|
"mac": {
|
||||||
"target": [
|
"target": [
|
||||||
{
|
|
||||||
"target": "dmg",
|
|
||||||
"arch": ["x64", "arm64"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"target": "zip",
|
|
||||||
"arch": ["x64", "arm64"]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"target": "mas",
|
"target": "mas",
|
||||||
"arch": ["x64", "arm64"]
|
"arch": ["x64", "arm64"]
|
||||||
@@ -79,28 +71,11 @@
|
|||||||
"category": "public.app-category.developer-tools",
|
"category": "public.app-category.developer-tools",
|
||||||
"hardenedRuntime": true,
|
"hardenedRuntime": true,
|
||||||
"gatekeeperAssess": false,
|
"gatekeeperAssess": false,
|
||||||
"entitlements": "build/entitlements.mac.plist",
|
"entitlements": "build/entitlements.mas.plist",
|
||||||
"entitlementsInherit": "build/entitlements.mac.plist",
|
"entitlementsInherit": "build/entitlements.mas.inherit.plist",
|
||||||
"type": "distribution",
|
"type": "distribution",
|
||||||
"minimumSystemVersion": "10.15"
|
"minimumSystemVersion": "10.15"
|
||||||
},
|
},
|
||||||
"dmg": {
|
|
||||||
"contents": [
|
|
||||||
{
|
|
||||||
"x": 130,
|
|
||||||
"y": 220
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"x": 410,
|
|
||||||
"y": 220,
|
|
||||||
"type": "link",
|
|
||||||
"path": "/Applications"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"artifactName": "${productName}-${version}-${arch}.${ext}",
|
|
||||||
"sign": false,
|
|
||||||
"writeUpdateInfo": false
|
|
||||||
},
|
|
||||||
"mas": {
|
"mas": {
|
||||||
"entitlements": "build/entitlements.mas.plist",
|
"entitlements": "build/entitlements.mas.plist",
|
||||||
"entitlementsInherit": "build/entitlements.mas.inherit.plist",
|
"entitlementsInherit": "build/entitlements.mas.inherit.plist",
|
||||||
@@ -112,6 +87,5 @@
|
|||||||
"extendInfo": {
|
"extendInfo": {
|
||||||
"ITSAppUsesNonExemptEncryption": false
|
"ITSAppUsesNonExemptEncryption": false
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"afterSign": "build/notarize.cjs"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,7 @@
|
|||||||
"build:linux-portable": "npm run build && electron-builder --linux --dir",
|
"build:linux-portable": "npm run build && electron-builder --linux --dir",
|
||||||
"build:linux-appimage": "npm run build && electron-builder --linux AppImage",
|
"build:linux-appimage": "npm run build && electron-builder --linux AppImage",
|
||||||
"build:linux-targz": "npm run build && electron-builder --linux tar.gz",
|
"build:linux-targz": "npm run build && electron-builder --linux tar.gz",
|
||||||
"build:mac-dmg": "npm run build && electron-builder --mac dmg",
|
"build:mac": "npm run build && electron-builder --mac",
|
||||||
"build:mac-zip": "npm run build && electron-builder --mac zip",
|
|
||||||
"build:mac-mas": "npm run build && electron-builder --mac mas",
|
|
||||||
"build:mac-universal": "npm run build && electron-builder --mac --universal",
|
|
||||||
"test:encryption": "tsc -p tsconfig.node.json && node ./dist/backend/backend/utils/encryption-test.js",
|
"test:encryption": "tsc -p tsconfig.node.json && node ./dist/backend/backend/utils/encryption-test.js",
|
||||||
"migrate:encryption": "tsc -p tsconfig.node.json && node ./dist/backend/backend/utils/encryption-migration.js",
|
"migrate:encryption": "tsc -p tsconfig.node.json && node ./dist/backend/backend/utils/encryption-migration.js",
|
||||||
"prepare": "husky"
|
"prepare": "husky"
|
||||||
|
|||||||
Reference in New Issue
Block a user