Skip to content

Commit

Permalink
Update linux-musl.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
userdocs committed Jan 3, 2025
1 parent 83e58d9 commit f260f95
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions .github/workflows/linux-musl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
build_method: [python, cmake]
include:
- arch: aarch64-linux-musl
binary_name: aarch64
Expand Down Expand Up @@ -70,31 +71,44 @@ jobs:
- 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 - Install ninja build optional dependencies
run: |
docker exec crossbuild sudo apk update
docker exec crossbuild sudo apk add --no-cache gtest gtest-dev python3
- 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
if: matrix.build_method == 'cmake'
run: >
docker exec crossbuild
cmake -B build
-D CMAKE_BUILD_TYPE="Release"
- 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
if: matrix.build_method == 'cmake'
run: docker exec crossbuild cmake --build build --parallel --config Release

- name: Host - Rename ${{ matrix.binary_name }} to ${{ env.release_asset }}
run: mv -f ${{ github.workspace }}/install/bin/ninja ninja-${{ matrix.binary_name }}
run: mv -f ${{ github.workspace }}/ninja ninja-${{ matrix.binary_name }}

- name: Docker - Python Build ${{ matrix.binary_name }}
if: matrix.build_method == 'python'
run: |
docker exec crossbuild ./configure.py --bootstrap --verbose
printf "%s\n" "build_method=-python" >> $GITHUB_ENV
- name: Host - ninja-${{ matrix.binary_name }} --version
run: ./ninja-${{ matrix.binary_name }} --version >> $GITHUB_STEP_SUMMARY
run: ./ninja-${{ matrix.binary_name }}${{ env.build_method }} --version >> $GITHUB_STEP_SUMMARY

- name: Host - crossbuild binary info via file
run: file ./ninja-${{ matrix.binary_name }} >> $GITHUB_STEP_SUMMARY
run: file ./ninja-${{ matrix.binary_name }}${{ env.build_method }} >> $GITHUB_STEP_SUMMARY

- name: Host - signed build provenance attestations
uses: actions/attest-build-provenance@v2
with:
subject-path: ninja-${{ matrix.binary_name }}
subject-path: ninja-${{ matrix.binary_name }}${{ env.build_method }}

- name: Upload artifact - ${{ matrix.binary_name }}
uses: actions/upload-artifact@v4
with:
name: ninja-${{ matrix.binary_name }}
path: ninja-${{ matrix.binary_name }}
name: ninja-${{ matrix.binary_name }}${{ env.build_method }}
path: ninja-${{ matrix.binary_name }}${{ env.build_method }}

0 comments on commit f260f95

Please sign in to comment.