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

clean up zap packaging ( win/mac adapter pack, linux artifact naming, jenkins artifact archiving)

linux:
  "artifactName" is required to produce correct artifact name. otherwise ${os} field is not produced.

mac:
  "afterAllArtifactBuild" is used as a workaround to copy apack.json to the root dir.

BUG: ZAPP-775
上级 66bda7f5
未找到相关分支
未找到相关标签
无相关合并请求
......@@ -220,11 +220,9 @@ pipeline
sh 'src-script/npm-update-binary || true'
sh 'security unlock-keychain -u "/Library/Keychains/System.keychain"'
sh 'npm run version-stamp'
sh 'npm run build-spa'
sh 'npm run build-backend'
sh 'npm run dist-mac'
sh 'npm run apack:mac'
stash includes: 'dist/zap_apack_mac.zip', name: 'zap_apack_mac'
sh 'npm run build'
sh 'npm run pack:mac'
stash includes: "dist/*mac.zip", name: 'zap_apack_mac'
}
}
}
......@@ -237,14 +235,12 @@ pipeline
script
{
sh 'echo "Building for Windows"'
sh 'xvfb-run -a npm run dist-win'
sh 'xvfb-run -a npm run apack:win'
stash includes: 'dist/zap_apack_win.zip', name: 'zap_apack_win'
sh 'xvfb-run -a npm run pack:win'
stash includes: "dist/*win.zip", name: 'zap_apack_win'
sh 'echo "Building for Linux"'
sh 'xvfb-run -a npm run dist-linux'
sh 'xvfb-run -a npm run apack:linux'
stash includes: 'dist/zap_apack_linux.zip', name: 'zap_apack_linux'
sh 'xvfb-run -a npm run pack:linux'
stash includes: 'dist/*linux.zip', name: 'zap_apack_linux'
}
}
}
......
......@@ -16626,6 +16626,18 @@
"integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=",
"dev": true
},
"lodash.defaultsdeep": {
"version": "4.6.1",
"resolved": "https://registry.npmjs.org/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz",
"integrity": "sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA==",
"dev": true
},
"lodash.defaultto": {
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/lodash.defaultto/-/lodash.defaultto-4.14.0.tgz",
"integrity": "sha1-OL09QlrO5zPg4ru9TkspcRzC7hE=",
"dev": true
},
"lodash.difference": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz",
......@@ -16638,6 +16650,12 @@
"integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=",
"dev": true
},
"lodash.flattendeep": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz",
"integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=",
"dev": true
},
"lodash.get": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
......@@ -16654,6 +16672,12 @@
"resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz",
"integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U="
},
"lodash.isempty": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz",
"integrity": "sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=",
"dev": true
},
"lodash.isequal": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-3.0.4.tgz",
......@@ -16694,6 +16718,12 @@
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="
},
"lodash.negate": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/lodash.negate/-/lodash.negate-3.0.2.tgz",
"integrity": "sha1-nIl7C/YQAZ4LQ7j/Pwr+89e2bzQ=",
"dev": true
},
"lodash.omit": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz",
......@@ -17810,6 +17840,38 @@
"lower-case": "^1.1.1"
}
},
"node-7z": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/node-7z/-/node-7z-3.0.0.tgz",
"integrity": "sha512-KIznWSxIkOYO/vOgKQfJEaXd7rgoFYKZbaurainCEdMhYc7V7mRHX+qdf2HgbpQFcdJL/Q6/XOPrDLoBeTfuZA==",
"dev": true,
"requires": {
"debug": "^4.3.2",
"lodash.defaultsdeep": "^4.6.1",
"lodash.defaultto": "^4.14.0",
"lodash.flattendeep": "^4.4.0",
"lodash.isempty": "^4.4.0",
"lodash.negate": "^3.0.2",
"normalize-path": "^3.0.0"
},
"dependencies": {
"debug": {
"version": "4.3.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
"integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
"dev": true,
"requires": {
"ms": "2.1.2"
}
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
}
}
},
"node-abi": {
"version": "2.30.1",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz",
......
......@@ -28,7 +28,9 @@
"test:e2e": "node src-script/zap-uitest.js open",
"test:e2e-ci": "node src-script/zap-uitest.js run",
"postinstall": "electron-builder install-app-deps && husky install && npm rebuild canvas --update-binary",
"wpzap": "npm run build-spa && npm run build-backend && npm run dist-mac && npm run apack:mac",
"buildAndPack:win": "npm run build && npm run pack:win",
"buildAndPack:mac": "npm run build && npm run pack:mac",
"buildAndPack:linux": "npm run build && npm run pack:linux",
"zap": "node src-script/zap-start.js --logToStdout --gen ./test/gen-template/zigbee/gen-templates.json",
"zap-dev": "npm run build-spa && quasar dev -m electron",
"zap-devserver": "node src-script/zap-start.js server --allowCors --logToStdout --gen ./test/gen-template/zigbee/gen-templates.json --reuseZapInstance",
......@@ -66,16 +68,11 @@
"convert-dl": "node src-script/zap-convert.js -o {basename}.zap -z ./zcl-builtin/silabs/zcl.json -g test/gen-template/zigbee/gen-templates.json ./test/resource/isc/ha-door-lock.isc",
"post-import": "node src-script/zap-start.js convert --postImportScript test/resource/test-script.js test/resource/three-endpoint-device.zap -o test.zap",
"analyze": "node src-script/zap-start.js analyze -z ./zcl-builtin/silabs/zcl.json -g ./test/gen-template/zigbee/gen-templates.json ./test/resource/three-endpoint-device.zap -o ./tmp",
"pack": "node src-script/build-spa.js && electron-builder --dir",
"dist": "electron-builder",
"dist-all": "electron-builder -mwl",
"dist-linux": "electron-builder -l",
"pack": "electron-builder -mwl",
"pack:linux": "electron-builder -l",
"pack:win": "electron-builder -w",
"pack:mac": "electron-builder -m",
"publish-linux": "electron-builder -l -p always",
"dist-win": "electron-builder -w",
"dist-mac": "electron-builder -m",
"apack:win": "cp apack.json dist/win-unpacked/apack.json && cd dist/win-unpacked && zip -r ../zap_apack_win * && cd -",
"apack:mac": "cp apack.json dist/mac/apack.json && cd dist/mac && zip -ry ../zap_apack_mac * && cd -",
"apack:linux": "cp apack.json dist/linux-unpacked/apack.json && cd dist/linux-unpacked && zip -r ../zap_apack_linux *",
"linuxpack-ui": "./dist/linux-unpacked/zap --zclProperties zcl-builtin/silabs/zcl-test.properties --genTemplateJson test/gen-template/zigbee/gen-templates.json",
"linuxpack-check": "./dist/linux-unpacked/zap selfCheck --zclProperties zcl-builtin/silabs/zcl-test.properties --genTemplateJson test/gen-template/zigbee/gen-templates.json",
"linuxpack-gen": "./dist/linux-unpacked/zap generate --noUi --noServer --zclProperties zcl-builtin/silabs/zcl-test.properties --genTemplateJson test/gen-template/zigbee/gen-templates.json --output tmp",
......@@ -161,6 +158,7 @@
"jsdom": "^16.6.0",
"jsdom-global": "^3.0.2",
"license-checker": "^25.0.1",
"node-7z": "^3.0.0",
"node-abi": "^2.30.0",
"node-gyp": "^8.1.0",
"node-pre-gyp": "^0.17.0",
......@@ -195,16 +193,19 @@
},
"build": {
"appId": "zap.id",
"artifactName": "${productName}-${version}-${os}.${ext}",
"afterAllArtifactBuild": "./src-script/pack-apack.js",
"mac": {
"category": "public.app-category.developer-tools",
"darkModeSupport": true,
"target": [
"dmg"
"zip"
]
},
"linux": {
"category": "Development",
"target": [
"zip",
"snap",
"AppImage",
"deb",
......@@ -214,7 +215,10 @@
},
"win": {
"target": [
"portable"
"zip"
],
"extraFiles": [
"apack.json"
]
},
"directories": {
......@@ -225,6 +229,7 @@
"npmRebuild": true,
"files": [
"**/*",
"apack.json",
"dist/backend",
"dist/src-electron",
"dist/src-shared",
......
const fs = require('fs')
const path = require('path')
const Seven = require('node-7z')
const sevenBin = require('7zip-bin')
const pathTo7zip = sevenBin.path7za
exports.default = async function (buildResult) {
buildResult?.artifactPaths?.forEach((element) => {
if (element.includes('mac') && element.endsWith('.zip')) {
const myStream = Seven.add(
element,
path.join(buildResult.outDir, '../apack.json'),
{
$progress: true,
$bin: pathTo7zip,
}
)
// myStream.on('end', function () {
// console.log(myStream.info)
// })
myStream.on('error', function (err) {
if (err) {
console.log(err.stderr)
throw err
}
})
}
})
}
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
想要评论请 注册