Skip to content

Build Node binaries for Alpine #4

Build Node binaries for Alpine

Build Node binaries for Alpine #4

Workflow file for this run

name: Build Node binaries for Alpine
on:
workflow_dispatch:
workflow_call:
jobs:
alpine:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
target-node: [14, 16, 18, 20]
target-arch: [x64, arm64]
include:
- target-arch: x64
target-triple: x86_64-linux-musl
host-arch: x86_64
- target-arch: arm64
target-triple: aarch64-linux-musl
host-arch: x86_64
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/build-push-action@v5
with:
build-args: |
HOST_ARCH=${{ matrix.host-arch }}
TARGET_TRIPLE=${{ matrix.target-triple }}
PKG_FETCH_OPTION_a=${{ matrix.target-arch }}
PKG_FETCH_OPTION_n=node${{ matrix.target-node }}
PKG_FETCH_OPTION_p=alpine
context: .
file: ./Dockerfile.alpine
platforms: linux/amd64
outputs: type=local, dest=dist
- name: Check if binary is compiled, skip if download only
id: check_file
run: |
ls -l dist
(test -f dist/*.sha256sum && echo "EXISTS=true" >> $GITHUB_OUTPUT) || echo "EXISTS=false" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
if: steps.check_file.outputs.EXISTS == 'true'
with:
name: node${{ matrix.target-node }}-alpine-${{ matrix.target-arch }}
path: dist/*