Use electron-builder beforeBuild (#164)

This commit is contained in:
Jan-Otto Kröpke 2023-06-30 19:33:12 +02:00 committed by GitHub
parent 32fca4b84b
commit 0f102c4f64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 8 deletions

View File

@ -55,16 +55,10 @@ jobs:
if [ "$RUNNER_OS" == "Windows" ]; then
npx nx run open-lens:build:app --win nsis msi portable
elif [ "$RUNNER_OS" == "Linux" ]; then
npx nx run open-lens:build:app
npm run all:reinstall
npx nx reset
sudo apt update
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
export CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++
mkdir -p open-lens/node_modules
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
npx nx run open-lens:build:app --arm64
npx nx run open-lens:build:app --x64 --arm64
find . -name '*pty.node' -print0 | xargs -0 file
else
npx nx run open-lens:build:app --x64 --arm64

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
.DS_Store
README.md
/lens/

View File

@ -0,0 +1,17 @@
const archMap = {
"amd64": "x86_64",
"arm64": "aarch64",
}
module.exports = async (buildContext) => {
if (buildContext.platform.name !== "linux") return true
if (buildContext.arch in archMap) {
process.env.CC = `${archMap[buildContext.arch]}-linux-gnu-gcc`
process.env.CXX = `${archMap[buildContext.arch]}-linux-gnu-g++`
} else {
process.env.CC = "gcc"
process.env.CXX = "g++"
}
return true
}

View File

@ -10,6 +10,7 @@ packageJsonOpenLens.build.publish = [{
packageJsonOpenLens.version = `${packageJsonOpenLens.version}-${process.env.BUILD_ID}`;
packageJsonOpenLens.build.npmRebuild = true;
packageJsonOpenLens.build.detectUpdateChannel = false;
packageJsonOpenLens.build.beforeBuild = '../../build-hooks/beforeBuild';
delete packageJsonOpenLens.scripts.postinstall;