Skip to content

Create linux-musl.yml #1

Create linux-musl.yml

Create linux-musl.yml #1

Workflow file for this run

name: ci-linux-musl
on:
workflow_dispatch:
pull_request:
push:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-24.04 # needs to be ubuntu-24.04 for qemu-user-static loongarch64 support
permissions:
contents: read
id-token: write
attestations: write
strategy:
fail-fast: false
matrix:
include:
- arch: aarch64-linux-musl
binary_name: aarch64
- arch: arm-linux-musleabi
binary_name: armv5
- arch: arm-linux-musleabihf
binary_name: armhf
- arch: armv6-linux-musleabihf
binary_name: armv6
- arch: armv7l-linux-musleabihf
binary_name: armv7
- arch: i686-linux-musl
binary_name: x86
- arch: x86_64-linux-musl
binary_name: x86_64
- arch: mips-linux-musl
binary_name: mips
- arch: mips64-linux-musl
binary_name: mips64
- arch: mips64el-linux-musl
binary_name: mips64el
- arch: mipsel-linux-musl
binary_name: mipsel
- arch: powerpc-linux-musl
binary_name: powerpc
- arch: powerpc64le-linux-musl
binary_name: powerpc64le
- arch: s390x-linux-musl
binary_name: s390x
- arch: riscv64-linux-musl
binary_name: riscv64
- arch: loongarch64-linux-musl
binary_name: loongarch64
name: ${{ matrix.arch }}
steps:
- name: Host - checkout
uses: actions/checkout@v4
- name: Host - update
run: sudo apt-get update
- name: Host - set up qemu-user-static binfmt-support
run: sudo apt-get install libpipeline1 qemu-user-static binfmt-support
- name: Host - Create docker crossbuild container
run: docker run --name crossbuild -it -d -e "LDFLAGS=-s -static --static" -w /home/github -v ${{ github.workspace }}:/home/github ghcr.io/userdocs/qbt-musl-cross-make:${{ matrix.arch }}
- name: Docker - Configure ${{ matrix.binary_name }}
run: docker exec crossbuild cmake -B build -D CMAKE_BUILD_TYPE="release" -D CMAKE_CXX_STANDARD="20" -D CMAKE_INSTALL_PREFIX=/home/github/install
- name: Docker - Cmake Build ${{ matrix.binary_name }}
run: docker exec crossbuild cmake --build build
- name: Docker - Cmake Install ${{ matrix.binary_name }}
run: docker exec crossbuild cmake --install build
- name: Host - Rename ${{ matrix.binary_name }} to ${{ env.release_asset }}
run: mv -f ${{ github.workspace }}/install/bin/ninja ninja-${{ matrix.binary_name }}
- name: Host - ninja-${{ matrix.binary_name }} --version
run: ./ninja-${{ matrix.binary_name }} --version >> $GITHUB_STEP_SUMMARY
- name: Host - crossbuild binary info via file
run: file ./ninja-${{ matrix.binary_name }} >> $GITHUB_STEP_SUMMARY
- name: Host - signed build provenance attestations
uses: actions/attest-build-provenance@v2
with:
subject-path: ninja-${{ matrix.binary_name }}
- name: Upload artifact - ${{ matrix.binary_name }}
uses: actions/upload-artifact@v4
with:
name: ninja-${{ matrix.binary_name }}
path: ninja-${{ matrix.binary_name }}