|
| 1 | +on: |
| 2 | + push: |
| 3 | + branches: |
| 4 | + - buildscripts |
| 5 | + |
| 6 | +env: |
| 7 | + LLVM_VERSION: 15.0.7 |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + include: |
| 13 | + - os: macos-14 |
| 14 | + arch: arm64 |
| 15 | + upload_includes: true |
| 16 | + - os: macos-14 |
| 17 | + arch: x86_64 |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + env: |
| 20 | + LLVM_ARCH: ${{ matrix.arch }} |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + repository: llvm/llvm-project |
| 25 | + ref: llvmorg-${{env.LLVM_VERSION}} |
| 26 | + - name: Install dependencies |
| 27 | + run: | |
| 28 | + brew install ninja |
| 29 | + - name: Build |
| 30 | + run: | |
| 31 | + cmake -S llvm -B build_osx -G "Ninja" -DCMAKE_OSX_DEPLOYMENT_TARGET=11 -DCMAKE_OSX_ARCHITECTURES=$LLVM_ARCH -DLLVM_ENABLE_RUNTIMES="" -DLLVM_ENABLE_PROJECTS="clang;lld;polly" -DLLVM_ENABLE_ASSERTIONS=Off -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/llvm -DLLVM_ENABLE_ZSTD=Off -DLLVM_HOST_TRIPLE=$LLVM_ARCH-apple-darwin -DBUILD_SHARED_LIBS=Off |
| 32 | + cmake --build build_osx --target install |
| 33 | + - name: Generate artifact |
| 34 | + run: | |
| 35 | + cd /tmp/llvm |
| 36 | + mkdir dist-lib |
| 37 | + mv lib dist-lib/lib_$LLVM_ARCH |
| 38 | + mkdir dist-include |
| 39 | + mv include dist-include/include |
| 40 | + - name: Upload artifact |
| 41 | + uses: actions/upload-artifact@v4 |
| 42 | + with: |
| 43 | + name: llvm-lib-${{env.LLVM_ARCH}} |
| 44 | + path: /tmp/llvm/dist-lib |
| 45 | + - name: Upload includes |
| 46 | + if: ${{ matrix.upload_includes }} |
| 47 | + uses: actions/upload-artifact@v4 |
| 48 | + with: |
| 49 | + name: llvm-include |
| 50 | + path: /tmp/llvm/dist-include |
| 51 | + artifacts: |
| 52 | + name: Assemble release |
| 53 | + permissions: |
| 54 | + contents: write |
| 55 | + runs-on: ubuntu-latest |
| 56 | + needs: [build] |
| 57 | + steps: |
| 58 | + - name: Download all artifacts |
| 59 | + uses: actions/download-artifact@v4 |
| 60 | + with: |
| 61 | + path: ${{env.LLVM_VERSION}} |
| 62 | + pattern: llvm-* |
| 63 | + merge-multiple: true |
| 64 | + - name: Create archive |
| 65 | + run: | |
| 66 | + tar -czf llvm-$LLVM_VERSION.tgz $LLVM_VERSION |
| 67 | + - name: Upload artifact |
| 68 | + uses: actions/upload-artifact@v4 |
| 69 | + with: |
| 70 | + name: llvm-${{env.LLVM_VERSION}} |
| 71 | + path: llvm-${{env.LLVM_VERSION}}.tgz |
| 72 | + - uses: ncipollo/release-action@v1 |
| 73 | + if: ${{ contains(github.ref, 'refs/tags/') }} |
| 74 | + with: |
| 75 | + artifacts: llvm-${{env.LLVM_VERSION}}.tgz |
0 commit comments