-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add workflow to build on Alpine, too
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Alpine | ||
|
||
on: push | ||
|
||
jobs: | ||
alpine: | ||
runs-on: ubuntu-22.04 | ||
container: alpine:latest | ||
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" | ||
# Checks-out the repository under $GITHUB_WORKSPACE. | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- 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/ | ||
VERSION=$(git describe --always) | ||
mv artifacts sha256_$VERSION | ||
tar czf sha256_${VERSION}_linux-amd64-generic.tar.gz sha256_$VERSION | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: sha256_linux-amd64-generic | ||
path: | | ||
sha256_*_linux-amd64-generic.tar.gz |