Skip to content
代码片段 群组 项目
提交 9c765305 编辑于 作者: Jing Teng's avatar Jing Teng
浏览文件

build for window/mac

macOS is used for building windows since it's a hassle to install wine32
on azure ubuntu20lts due to package dependency issues
上级 4b99ac03
No related branches found
No related tags found
无相关合并请求
name: Build/release
on: push
jobs:
release:
runs-on: ${{ matrix.os }}
# Platforms to build on/for
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
fail-fast: false
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3.0.0
with:
node-version: 14.x
- name: Prepare Linux for build/release
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo ./src-script/install-packages-ubuntu
sudo apt-get install --fix-missing xvfb
- name: Prepare macOS for build/release
if: startsWith(matrix.os, 'macos')
run: |
./src-script/install-packages-osx
- name: Prepare for app notarization (macOS)
if: startsWith(matrix.os, 'macos')
# Import Apple API key for app notarization on macOS
run: |
mkdir -p ~/private_keys/
echo '${{ secrets.api_key }}' > ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8
- run: npm install
- run: npm run version-stamp
- run: npm rebuild canvas --update-binary
- run: npm rebuild libxmljs --update-binary
- run: npm run build-spa
- run: npm run lint
- run: npm run test
if: startsWith(matrix.os, 'ubuntu')
- run: xvfb-run -a npm run self-check
if: startsWith(matrix.os, 'ubuntu')
- run: npm run gen
- run: npm run genmatter
- run: npm run gendotdot
- run: xvfb-run -a npm run test:e2e-ci
if: startsWith(matrix.os, 'ubuntu')
- name: Build/release Electron app for macOS / Windows
uses: samuelmeuli/action-electron-builder@v1.6.0
if: startsWith(matrix.os, 'macos')
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
# macOS code signing certificate
mac_certs: ${{ secrets.mac_certs }}
mac_certs_password: ${{ secrets.mac_certs_password }}
# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
args: '--windows'
env:
# macOS notarization API key
API_KEY_ID: ${{ secrets.api_key_id }}
API_KEY_ISSUER_ID: ${{ secrets.api_key_issuer_id }}
- name: Build/release Electron app for Linux
uses: samuelmeuli/action-electron-builder@v1.6.0
if: startsWith(matrix.os, 'ubuntu')
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
# macOS code signing certificate
mac_certs: ${{ secrets.mac_certs }}
mac_certs_password: ${{ secrets.mac_certs_password }}
# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
env:
# macOS notarization API key
API_KEY_ID: ${{ secrets.api_key_id }}
API_KEY_ISSUER_ID: ${{ secrets.api_key_issuer_id }}
- name: Archive .exe file
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'macos')
with:
name: zap-win-exe
path: dist/zap*.exe
- name: Archive .dmg file
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'macos')
with:
name: zap-macosx-dmg
path: dist/zap*.dmg
- name: Archive .rpm file
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'ubuntu')
with:
name: zap-linux-rpm
path: dist/zap*.rpm
- name: Archive .deb file
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'ubuntu')
with:
name: zap-linux-deb
path: dist/zap*.deb
{ {
"name": "zap", "name": "zap",
"version": "2022.2.11", "version": "2022.2.22",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
...@@ -6759,6 +6759,44 @@ ...@@ -6759,6 +6759,44 @@
} }
} }
}, },
"copyfiles": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz",
"integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==",
"dev": true,
"requires": {
"glob": "^7.0.5",
"minimatch": "^3.0.3",
"mkdirp": "^1.0.4",
"noms": "0.0.0",
"through2": "^2.0.1",
"untildify": "^4.0.0",
"yargs": "^16.1.0"
},
"dependencies": {
"yargs": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
"dev": true,
"requires": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
}
},
"yargs-parser": {
"version": "20.2.9",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
"dev": true
}
}
},
"core-js": { "core-js": {
"version": "3.20.2", "version": "3.20.2",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.20.2.tgz", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.20.2.tgz",
...@@ -18248,6 +18286,42 @@ ...@@ -18248,6 +18286,42 @@
"integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==",
"dev": true "dev": true
}, },
"noms": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz",
"integrity": "sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=",
"dev": true,
"requires": {
"inherits": "^2.0.1",
"readable-stream": "~1.0.31"
},
"dependencies": {
"isarray": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
"dev": true
},
"readable-stream": {
"version": "1.0.34",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
"integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
"dev": true,
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "0.0.1",
"string_decoder": "~0.10.x"
}
},
"string_decoder": {
"version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
"dev": true
}
}
},
"nopt": { "nopt": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",
......
{ {
"type": "commonjs", "type": "commonjs",
"name": "zap", "name": "zap",
"version": "2022.2.25", "version": "2022.2.26",
"description": "Configuration tool for the Zigbee Cluster Library", "description": "Configuration tool for the Zigbee Cluster Library",
"productName": "zap", "productName": "zap",
"cordovaId": "", "cordovaId": "",
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
"build": "npm run build-spa && npm run build-backend", "build": "npm run build-spa && npm run build-backend",
"build-spa": "node src-script/build-spa.js", "build-spa": "node src-script/build-spa.js",
"build-backend": "npx tsc --build ./tsconfig.json", "build-backend": "npx tsc --build ./tsconfig.json",
"postbuild-backend": "npx copyfiles './src-electron/**/*.sql' ./dist/",
"regen-ts-type": "node src-script/regen-ts-type.js", "regen-ts-type": "node src-script/regen-ts-type.js",
"renderer-api-regen": "node src-script/renderer-api-regen.js", "renderer-api-regen": "node src-script/renderer-api-regen.js",
"doc": "jsdoc src-electron src-shared -r -u docs -d ./generated-html/ README.md", "doc": "jsdoc src-electron src-shared -r -u docs -d ./generated-html/ README.md",
...@@ -132,6 +133,7 @@ ...@@ -132,6 +133,7 @@
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"babel-jest": "^26.6.3", "babel-jest": "^26.6.3",
"copy-webpack-plugin": "^6.3.2", "copy-webpack-plugin": "^6.3.2",
"copyfiles": "^2.4.1",
"devtron": "^1.4.0", "devtron": "^1.4.0",
"electron": "^12.2.2", "electron": "^12.2.2",
"electron-builder": "^22.11.7", "electron-builder": "^22.11.7",
...@@ -202,6 +204,7 @@ ...@@ -202,6 +204,7 @@
] ]
}, },
"linux": { "linux": {
"category": "Development",
"target": [ "target": [
"snap", "snap",
"AppImage", "AppImage",
...@@ -246,7 +249,8 @@ ...@@ -246,7 +249,8 @@
"!**/node_modules/sqlite3/build/Release/**/*", "!**/node_modules/sqlite3/build/Release/**/*",
"!quasar*", "!quasar*",
"!test.*", "!test.*",
"!src-script/**/*" "!src-script/**/*",
"!src-electron/**/*"
] ]
} }
} }
...@@ -111,9 +111,7 @@ export function setProductionEnv() { ...@@ -111,9 +111,7 @@ export function setProductionEnv() {
// @ts-ignore // @ts-ignore
global.__statics = path.join(__dirname, 'statics').replace(/\\/g, '\\\\') global.__statics = path.join(__dirname, 'statics').replace(/\\/g, '\\\\')
// @ts-ignore // @ts-ignore
global.__backend = path global.__backend = path.join(__dirname, '../').replace(/\\/g, '\\\\')
.join(__dirname, '../../../src-electron')
.replace(/\\/g, '\\\\')
httpStaticContentPath = path httpStaticContentPath = path
.join(__dirname, '../../../spa') .join(__dirname, '../../../spa')
.replace(/\\/g, '\\\\') .replace(/\\/g, '\\\\')
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册