Skip to content

Commit

Permalink
fix: emulated build instead of cross build
Browse files Browse the repository at this point in the history
  • Loading branch information
mloiseleur committed Dec 27, 2023
1 parent 2524a5a commit 51c8675
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
49 changes: 28 additions & 21 deletions .github/workflows/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
cli:
if: false
name: Build CLI ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -154,10 +155,7 @@ jobs:
- setup
env:
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
# The only known way to get arm64 argon2 is to build it from sources
npm_config_arch: arm64
npm_config_build_from_source: true
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}.19.0
steps:
- name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
Expand All @@ -168,24 +166,31 @@ jobs:
echo "SHORT_RUNNER_OS=$(echo $RUNNER_OS | awk '{print substr($0, 1, 3)}' | \
awk '{print tolower($0)}')" >> $GITHUB_ENV
- name: Configure binfmt with QEMU User Emulation
run: |
sudo apt install binfmt-support qemu-user-static
update-binfmts --display
- name: Set up Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
- name: Build on arm64
uses: uraimo/run-on-arch-action@v2
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
node-version: ${{ env._NODE_VERSION }}

- name: Install
run: npm ci
working-directory: ./

- name: Build & Package Unix
run: npm run dist:${{ env.SHORT_RUNNER_OS }}:arm64 --quiet
arch: aarch64
distro: bullseye
githubToken: ${{ github.token }}
setup: mkdir -p "${PWD}/dist"
dockerRunArgs: --volume "${PWD}:/dist"
env: |
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
DEBIAN_FRONTEND: noninteractive
GIT_SAFE_DIR: true
install: |
apt-get update
apt-get install -y -q make g++ xz-utils wget
echo "https://nodejs.org/dist/v${{ env._NODE_VERSION }}/node-v${{ env._NODE_VERSION }}-linux-arm64.tar.xz"
wget -q "https://nodejs.org/dist/v${{ env._NODE_VERSION }}/node-v${{ env._NODE_VERSION }}-linux-arm64.tar.xz"
tar --strip 1 -xJf "node-v${{ env._NODE_VERSION }}-linux-arm64.tar.xz" -C /usr/
rm -f "node-v${{ env._NODE_VERSION }}-linux-arm64.tar.xz"
run: |
uname -a
ls /lib
npm ci
npm run dist:lin:arm64 --quiet
- name: Zip Unix
run: |
Expand Down Expand Up @@ -213,6 +218,7 @@ jobs:
if-no-files-found: error

cli-windows:
if: false
name: Build CLI Windows
runs-on: windows-2019
needs:
Expand Down Expand Up @@ -358,6 +364,7 @@ jobs:
if-no-files-found: error

snap:
if: false
name: Build Snap
runs-on: ubuntu-22.04
needs: [setup, cli]
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,6 @@
},
"engines": {
"node": "~18",
"npm": "~9"
"npm": "~10"
}
}

0 comments on commit 51c8675

Please sign in to comment.