Skip to content

Commit

Permalink
Fix linux arm64 builds (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke authored Jun 15, 2023
1 parent c4b0994 commit 8cb4107
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-20.04, macos-latest, windows-latest]
os: [ ubuntu-20.04, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
timeout-minutes: 360
env:
BUILD_ID: ${{ github.run_number }}
steps:
- name: Checkout OpenLens
uses: actions/checkout@v3

- name: Export version to variable
run: |
export LENS_VERSION=$(cat version)
echo "LENS_VERSION=$LENS_VERSION" >> $GITHUB_ENV
echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
run: echo "LENS_VERSION=$(cat version)" >> $GITHUB_ENV
shell: bash

- uses: actions/setup-node@v3
Expand All @@ -38,15 +38,14 @@ jobs:
fetch-depth: 1

- name: Patch Upstream Lens
run: |
node update.js
run: node update.js

- name: Build Lens
run: |
npm run all:install
# Avoid npm install from electron-builder
# ref: https://github.com/electron-userland/electron-builder/blob/80a3ae857b9305aff1774e1b2b932601af50231b/packages/app-builder-lib/src/util/yarn.ts#L11-L16
mkdir open-lens/node_modules
mkdir -p open-lens/node_modules
if [ "${CSC_LINK}" = "" ] || [ "${CSC_KEY_PASSWORD}" = "" ]; then
unset CSC_LINK
Expand All @@ -55,8 +54,21 @@ 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
npx nx run open-lens:build:app --arm64
find . -name '*pty.node' -print0 | xargs -0 file
else
npx nx run open-lens:build:app --x64 --arm64
find . -name '*pty.node' -print0 | xargs -0 file
fi
rm -f open-lens/dist/*blockmap{,*}
Expand Down
5 changes: 4 additions & 1 deletion update.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ packageJsonOpenLens.build.publish = [{
provider: "generic"
}];

packageJsonOpenLens.version = `${packageJsonOpenLens.version}-${process.env.BUILD_NUMBER}`;
packageJsonOpenLens.version = `${packageJsonOpenLens.version}-${process.env.BUILD_ID}`;
packageJsonOpenLens.build.npmRebuild = true;
packageJsonOpenLens.build.detectUpdateChannel = false;

delete packageJsonOpenLens.scripts.postinstall;

packageJsonOpenLens.copyright = [
packageJsonOpenLens.copyright,
'',
Expand Down

0 comments on commit 8cb4107

Please sign in to comment.