🐛 Fix: Build Multi archs #32
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
prepare: | |
name: Prepare job | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set output | |
id: vars | |
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
- name: Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
check-latest: true | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Pre-build | |
run: npm run build:release -- --pre-build | |
- uses: actions/upload-artifact@v4 | |
name: Upload artifact | |
with: | |
name: pre-build | |
path: ./build | |
build_multi_linux: | |
name: Build Linux ${{ matrix.arch }} | |
needs: prepare | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [aarch64, x64] | |
node-version: [20.x] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Display structure | |
run: ls | |
- uses: actions/download-artifact@v4 | |
with: | |
github-token: ${{ github.token }} | |
name: pre-build | |
path: ./build | |
- uses: uraimo/run-on-arch-action@v2 | |
name: Build artifact ${{ matrix.arch }} | |
if: matrix.arch == 'aarch64' | |
id: build | |
with: | |
arch: ${{ matrix.arch }} | |
distro: ubuntu-latest | |
githubToken: ${{ github.token }} | |
install: | | |
apt update && apt upgrade -y && apt install -y curl | |
curl -fsSL https://fnm.vercel.app/install | bash | |
fnm install ${{ matrix.node-version }} | |
fnm use ${{ matrix.node-version }} | |
rm -rf node_modules && npm i | |
run: | | |
npm run build:release -- --only-build | |
- name: Node.js ${{ matrix.node-version }} | |
if: matrix.arch == 'x64' | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
check-latest: true | |
- name: Rebuild Modules | |
if: matrix.arch == 'x64' | |
run: rm -rf node_modules && npm ci | |
- name: Build Release | |
if: matrix.arch == 'x64' | |
run: npm run build:release -- --only-build | |
- uses: actions/upload-artifact@v4 | |
name: Upload artifact | |
with: | |
name: build-ubuntu-latest-${{ matrix.arch }} | |
path: ./build | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: release/* | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true |