musllvm

musl and LLVM cross-toolchain build system
git clone https://git.daat.foo/repos/musllvm.git
Log | Files | Refs | README | LICENSE

release.yml (3239B)


      1 name: Publish toolchains
      2 
      3 on:
      4   push:
      5     branches: [main]
      6     paths:
      7       - sources.list
      8       - config.mk
      9       - Makefile
     10       - scripts/**
     11       - '!scripts/test.sh'
     12       - files/**
     13       - tests/hello.*
     14       - tests/cmake/**
     15       - .github/workflows/release.yml
     16   workflow_dispatch:
     17 
     18 permissions:
     19   contents: read
     20 
     21 concurrency:
     22   group: publish-toolchains
     23   cancel-in-progress: false
     24 
     25 jobs:
     26   check:
     27     if: github.ref == 'refs/heads/main'
     28     runs-on: ubuntu-24.04
     29     steps:
     30       - uses: actions/checkout@v4
     31       - run: make check
     32 
     33   build:
     34     needs: check
     35     runs-on: ubuntu-24.04
     36     timeout-minutes: 360
     37     strategy:
     38       fail-fast: false
     39       matrix:
     40         arch: [x86_64, aarch64]
     41     env:
     42       ARCH: ${{ matrix.arch }}
     43       LLVM_MODE: source
     44       HOST_LDFLAGS: -static-libstdc++ -static-libgcc
     45     steps:
     46       - uses: actions/checkout@v4
     47       - name: Install host dependencies
     48         run: |
     49           sudo apt-get update
     50           sudo apt-get install -y clang-19 lld-19 llvm-19 llvm-19-dev cmake ninja-build curl xz-utils perl rsync pkg-config qemu-user
     51           echo /usr/lib/llvm-19/bin >> "$GITHUB_PATH"
     52       - uses: actions/cache@v4
     53         with:
     54           path: sources
     55           key: sources-${{ hashFiles('sources.list') }}
     56       - name: Build and package
     57         run: |
     58           if [ "$ARCH" = aarch64 ]; then
     59             echo RUNNER=qemu-aarch64 >> "$GITHUB_ENV"
     60             export RUNNER=qemu-aarch64
     61           fi
     62           make runtimes JOBS=2 LINK_JOBS=1
     63           make package
     64       - name: Verify the unpacked toolchain
     65         run: |
     66           target="$ARCH-linux-musl"
     67           archive="build/releases/musllvm-$target-host-x86_64-linux.tar.xz"
     68           unpacked="$RUNNER_TEMP/toolchains"
     69           mkdir -p "$unpacked"
     70           mv "build/$target" "$RUNNER_TEMP/original-$target"
     71           tar -xJf "$archive" -C "$unpacked"
     72           make verify PREFIX="$unpacked/musllvm-$target" \
     73             BUILD_DIR="$PWD/build/release-verify/$target" JOBS=2
     74       - uses: actions/upload-artifact@v4
     75         with:
     76           name: release-toolchain-${{ matrix.arch }}
     77           path: |
     78             build/releases/*.tar.xz
     79             build/releases/*.sha256
     80           if-no-files-found: error
     81           compression-level: 0
     82           retention-days: 7
     83       - name: Save build diagnostics
     84         if: failure()
     85         uses: actions/upload-artifact@v4
     86         with:
     87           name: release-diagnostics-${{ matrix.arch }}
     88           path: |
     89             build/work/**/CMakeCache.txt
     90             build/work/**/CMakeFiles/CMakeConfigureLog.yaml
     91             build/**/verify/*.header
     92             build/**/verify/*.segments
     93             build/**/verify/*.dynamic
     94           retention-days: 7
     95 
     96   publish:
     97     needs: build
     98     runs-on: ubuntu-24.04
     99     permissions:
    100       contents: write
    101     steps:
    102       - uses: actions/checkout@v4
    103         with:
    104           persist-credentials: false
    105       - uses: actions/download-artifact@v4
    106         with:
    107           pattern: release-toolchain-*
    108           merge-multiple: true
    109           path: build/releases
    110       - name: Publish the release
    111         env:
    112           GH_TOKEN: ${{ github.token }}
    113           GH_REPO: ${{ github.repository }}
    114         run: sh scripts/publish.sh