From f260f95967f3b1aa897cee3ed83e44da2c993618 Mon Sep 17 00:00:00 2001 From: userdocs <16525024+userdocs@users.noreply.github.com> Date: Fri, 3 Jan 2025 19:52:21 +0000 Subject: [PATCH] Update linux-musl.yml --- .github/workflows/linux-musl.yml | 36 ++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/workflows/linux-musl.yml b/.github/workflows/linux-musl.yml index a9aa5bd98e..3d9b11fd4a 100644 --- a/.github/workflows/linux-musl.yml +++ b/.github/workflows/linux-musl.yml @@ -21,6 +21,7 @@ jobs: strategy: fail-fast: false matrix: + build_method: [python, cmake] include: - arch: aarch64-linux-musl binary_name: aarch64 @@ -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 }}