ci: add build workflow for Alpine Linux on ARM 64 #1
Workflow file for this run
This file contains hidden or 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: Alpine on ARM | |
on: push | |
jobs: | |
alpine: | |
runs-on: ubuntu-24.04-arm | |
container: | |
image: 'alpine:3.22' | |
# Volume needed for monkey-patch step. | |
volumes: | |
- /:/host | |
steps: | |
# Git is required so that actions/checkout does a proper Git checkout. | |
- name: Install Git in container | |
run: | | |
apk update | |
apk add git | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Monkey-patch Alpine Node.js into runner | |
# This step is required because the actions refuse to run on ARM 64 | |
# while in a container. So the OS ID is changed and the host's Node.js | |
# binary is replaced with the one from the container. | |
# Works for now, but may fail when Node or other stuff gets updated on | |
# the runner's side. | |
run: | | |
apk add nodejs | |
sed -i 's~ID=alpine~ID=nopine~g' /etc/os-release | |
cd /host/home/runner/runners/*/externals/ | |
rm -rf node20/* | |
mkdir node20/bin | |
ln -s /usr/bin/node node20/bin/node | |
# Checks-out the repository under $GITHUB_WORKSPACE. | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: Install packages | |
run: | | |
apk update | |
apk add cmake g++ git make | |
- name: Build statically linked binaries | |
run: | | |
cd "$GITHUB_WORKSPACE" | |
mkdir build-static | |
cd build-static | |
cmake ../ -DENABLE_LTO=ON -DENABLE_STATIC_LINKING=ON | |
# Only build the executable, no tests. | |
cmake --build . -j2 --target sha256 | |
- name: Collect files | |
run: | | |
mkdir -p "$GITHUB_WORKSPACE"/artifacts | |
cd "$GITHUB_WORKSPACE" | |
cp build-static/sha256/sha256 artifacts/ | |
cp ReadMe.de.txt artifacts/ | |
cp ReadMe.en.txt artifacts/ | |
cp ChangeLog.md artifacts/ | |
cp LICENSE artifacts/ | |
cp third-party.md artifacts/ | |
VERSION=$(git describe --always) | |
mv artifacts sha256_$VERSION | |
tar czf sha256_${VERSION}_linux-arm64-generic.tar.gz sha256_$VERSION | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sha256_linux-arm64-generic | |
path: | | |
sha256_*_linux-arm64-generic.tar.gz |