Set build version programmatically in build-helper, fix broken build-universal script (#319)

* Set build version programmatically in build-helper

* remove env var definition

* fix paths in helper scripts

* missing import

* missed some more relative paths
This commit is contained in:
Evan Simkowitz 2024-02-23 15:14:25 -08:00 committed by GitHub
parent 7b692e2644
commit 0c3766c67b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 34 additions and 26 deletions

View File

@ -1,7 +1,6 @@
name: "Build Helper"
on: workflow_dispatch
env:
WAVETERM_VERSION: 0.6.1
GO_VERSION: "1.21.5"
NODE_VERSION: "21.5.0"
jobs:
@ -44,6 +43,9 @@ jobs:
with:
node-version: ${{env.NODE_VERSION}}
cache: "yarn"
- run: |
VERSION=$(node -e 'console.log(require("./version.js"))')
echo "WAVETERM_VERSION=${VERSION:1}" >> $GITHUB_ENV
- run: yarn --frozen-lockfile
- run: ./scripthaus/scripthaus run ${{ matrix.scripthaus }}
- uses: actions/upload-artifact@v4

View File

@ -1,9 +1,9 @@
const eu = require("@electron/universal");
const path = require("path");
let x64Path = path.resolve(__dirname, "temp", "x64", "Wave.app")
let arm64Path = path.resolve(__dirname, "temp", "arm64", "Wave.app")
let outPath = path.resolve(__dirname, "temp", "Wave.app")
const x64Path = path.resolve(__dirname, "temp", "x64", "Wave.app");
const arm64Path = path.resolve(__dirname, "temp", "arm64", "Wave.app");
const outPath = path.resolve(__dirname, "temp", "Wave.app");
console.log("building universal package");
console.log("x64 path", x64Path);

View File

@ -56,18 +56,18 @@ TEMP_WAVE_DIR_X64=$TEMP_DIR/arm64/Wave.app
TEMP_WAVE_DIR_UNIVERSAL=$TEMP_DIR/Wave.app
lipo -create -output $TEMP_DIR/wavesrv $TEMP_WAVE_DIR_X64/Contents/Resources/app/bin/wavesrv $TEMP_WAVE_DIR_ARM/Contents/Resources/app/bin/wavesrv
rm -rf $TEMP_WAVE_DIR_ARM/Contents/Resources/app
mv $TEMP_WAVE_DIR_X64/Contents/Resources/app temp/
cp $TEMP_DIR/wavesrv temp/app/bin/wavesrv
mv $TEMP_WAVE_DIR_X64/Contents/Resources/app $TEMP_DIR
cp $TEMP_DIR/wavesrv $TEMP_DIR/app/bin/wavesrv
mkdir $TEMP_WAVE_DIR_ARM/Contents/Resources/app
mkdir $TEMP_WAVE_DIR_X64/Contents/Resources/app
node $SCRIPT_DIR/build-universal.js
rm -rf $TEMP_WAVE_DIR_UNIVERSAL/Contents/Resources/app
mv $TEMP_DIR/app $TEMP_WAVE_DIR_UNIVERSAL/Contents/Resources/app
node $SCRIPT_DIR/osx-sign.js
DEBUG=electron-notarize node osx-notarize.js
DEBUG=electron-notarize node $SCRIPT_DIR/osx-notarize.js
echo "universal app creation success (build/sign/notarize)"
UVERSION=$(node -e 'console.log(require("../version.js"))')
UVERSION=$(node -e "console.log(require('${SCRIPT_DIR}/../version.js'))")
UPACKAGE_NAME="waveterm-macos-universal-${UVERSION}"
echo "creating universal zip"

View File

@ -1,14 +1,18 @@
const { notarize } = require('@electron/notarize');
// DEBUG=electron-notarize
const { notarize } = require("@electron/notarize");
const path = require("path");
console.log("running osx-notarize");
const waveAppPath = path.resolve(__dirname, "temp", "Wave.app");
notarize({
appPath: "temp/Wave.app",
appPath: waveAppPath,
tool: "notarytool",
keychainProfile: "notarytool-creds",
}).then(() => {
console.log("notarize success");
}).catch((e) => {
console.log("notarize error", e);
process.exit(1);
});
})
.then(() => {
console.log("notarize success");
})
.catch((e) => {
console.log("notarize error", e);
process.exit(1);
});

View File

@ -1,10 +1,10 @@
const { signAsync } = require("@electron/osx-sign");
// DEBUG="electron-osx-sign*"
const path = require("path");
console.log("running osx-sign");
let waveAppPath = "temp/Wave.app";
const waveAppPath = path.resolve(__dirname, "temp", "Wave.app");
signAsync({
app: "temp/Wave.app",
app: waveAppPath,
binaries: [
waveAppPath + "/Contents/Resources/app/bin/wavesrv",
waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.4-linux.amd64",
@ -12,9 +12,11 @@ signAsync({
waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.4-darwin.amd64",
waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.4-darwin.arm64",
],
}).then(() => {
console.log("signing success");
}).catch((e) => {
console.log("signing error", e);
process.exit(1);
});
})
.then(() => {
console.log("signing success");
})
.catch((e) => {
console.log("signing error", e);
process.exit(1);
});