mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-06 02:30:47 -08:00
feat: provide macos arm m1 package and sign it
This commit is contained in:
parent
dbce1debf5
commit
b67d531ce0
3 changed files with 17 additions and 11 deletions
17
.github/workflows/release.yml
vendored
17
.github/workflows/release.yml
vendored
|
|
@ -125,15 +125,14 @@ jobs:
|
||||||
CI: true
|
CI: true
|
||||||
CI_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
|
CI_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# Seems M1 can use x64 package, but arm package will show its broken
|
- name: Make macOS (arm64)
|
||||||
# - name: Make macOS (arm64)
|
run: npm run make:mac-arm
|
||||||
# run: npm run make:mac-arm
|
env:
|
||||||
# env:
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||||
# APPLE_ID: ${{ secrets.APPLE_ID }}
|
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
||||||
# APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
CI: true
|
||||||
# CI: true
|
CI_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
|
||||||
# CI_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
"test-without-package": "mkdir -p logs && cross-env NODE_ENV=test cucumber-js",
|
"test-without-package": "mkdir -p logs && cross-env NODE_ENV=test cucumber-js",
|
||||||
"package": "npm run init:git-submodule && electron-forge package",
|
"package": "npm run init:git-submodule && electron-forge package",
|
||||||
"make:mac-x64": "npm run init:git-submodule && cross-env NODE_ENV=production electron-forge make --platform=darwin --arch=x64",
|
"make:mac-x64": "npm run init:git-submodule && cross-env NODE_ENV=production electron-forge make --platform=darwin --arch=x64",
|
||||||
|
"make:mac-arm": "npm run init:git-submodule && cross-env NODE_ENV=production electron-forge make --platform=darwin --arch=arm64",
|
||||||
"make:win-x64": "npm run init:git-submodule && cross-env NODE_ENV=production electron-forge make --platform=win32 --arch=x64",
|
"make:win-x64": "npm run init:git-submodule && cross-env NODE_ENV=production electron-forge make --platform=win32 --arch=x64",
|
||||||
"make:win-ia32": "npm run init:git-submodule && cross-env NODE_ENV=production electron-forge make --platform=win32 --arch=ia32",
|
"make:win-ia32": "npm run init:git-submodule && cross-env NODE_ENV=production electron-forge make --platform=win32 --arch=ia32",
|
||||||
"make:win-arm": "npm run init:git-submodule && cross-env NODE_ENV=production electron-forge make --platform=win32 --arch=arm64",
|
"make:win-arm": "npm run init:git-submodule && cross-env NODE_ENV=production electron-forge make --platform=win32 --arch=arm64",
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,10 @@ const keepingLprojRegEx = /(en|zh_CN)\.lproj/g;
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
exports.default = async (buildPath, electronVersion, platform, arch, callback) => {
|
exports.default = async (buildPath, electronVersion, platform, arch, callback) => {
|
||||||
const cwd = path.join(buildPath, '..');
|
const cwd = path.resolve(buildPath, '..');
|
||||||
const projectRoot = path.join(__dirname, '..');
|
const projectRoot = path.resolve(__dirname, '..');
|
||||||
|
const appParentPath = path.resolve(buildPath, '..', '..', '..', '..');
|
||||||
|
const appPath = path.join(appParentPath, 'Electron.app');
|
||||||
|
|
||||||
/** delete useless lproj files to make it clean */
|
/** delete useless lproj files to make it clean */
|
||||||
const lproj = glob.sync('*.lproj', { cwd });
|
const lproj = glob.sync('*.lproj', { cwd });
|
||||||
|
|
@ -48,6 +50,10 @@ exports.default = async (buildPath, electronVersion, platform, arch, callback) =
|
||||||
await exec(`npm i --legacy-building`, { cwd: path.join(cwd, 'node_modules', 'zx', 'node_modules', 'globby') });
|
await exec(`npm i --legacy-building`, { cwd: path.join(cwd, 'node_modules', 'zx', 'node_modules', 'globby') });
|
||||||
await exec(`npm i --legacy-building --ignore-scripts`, { cwd: path.join(cwd, 'node_modules', 'zx', 'node_modules', 'node-fetch') });
|
await exec(`npm i --legacy-building --ignore-scripts`, { cwd: path.join(cwd, 'node_modules', 'zx', 'node_modules', 'node-fetch') });
|
||||||
}
|
}
|
||||||
|
/** sign it for mac m1 https://www.zhihu.com/question/431722091/answer/1592339574 */
|
||||||
|
if (platform === 'darwin') {
|
||||||
|
await exec(`xattr -rd com.apple.quarantine ${appPath}`, { cwd: appParentPath });
|
||||||
|
}
|
||||||
/** complete this hook */
|
/** complete this hook */
|
||||||
callback();
|
callback();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue