|
| 1 | +name: "Build LLVM" |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + tag: |
| 7 | + description: 'Git tag for the release.' |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + |
| 11 | +jobs: |
| 12 | + build_llvm: |
| 13 | + name: Build LLVM |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + # os: [ubuntu-20.04, macos-11, windows-2019] |
| 17 | + os: [ubuntu-20.04] |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + permissions: |
| 20 | + contents: write # for creating releases |
| 21 | + container: |
| 22 | + # Intentionally old ubuntu version with old glibc. |
| 23 | + image: ubuntu:18.04 |
| 24 | + steps: |
| 25 | + - name: checkout |
| 26 | + uses: actions/checkout@v3 |
| 27 | + |
| 28 | + # Install build dependencies. |
| 29 | + - run: "apt update && apt install -y clang git wget build-essential python3 ninja-build" |
| 30 | + # cmake from package manager is to old for the LLVM build. |
| 31 | + - run: "wget https://github.com/Kitware/CMake/releases/download/v3.30.0-rc2/cmake-3.30.0-rc2-linux-x86_64.sh" |
| 32 | + - run: "chmod +x cmake-*.sh" |
| 33 | + - run: "./cmake-*.sh --skip-license --prefix=/usr" |
| 34 | + # Build and package LLVM. |
| 35 | + - run: "./build-llvm-libs.sh" |
| 36 | + - uses: actions/upload-artifact@v3 |
| 37 | + with: |
| 38 | + name: llvm-static-libs |
| 39 | + path: llvm-static-libs.tar.gz |
| 40 | + - name: create release |
| 41 | + id: create-release |
| 42 | + uses: actions/create-release@v1 |
| 43 | + env: |
| 44 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 45 | + with: |
| 46 | + tag_name: ${{ inputs.tag }} |
| 47 | + release_name: ${{ inputs.tag }} |
| 48 | + draft: false |
| 49 | + prerelease: true |
| 50 | + - name: upload linux artifact |
| 51 | + uses: actions/upload-release-asset@v1 |
| 52 | + env: |
| 53 | + GITHUB_TOKEN: ${{ github.token }} |
| 54 | + with: |
| 55 | + upload_url: ${{ steps.create-release.outputs.upload_url }} |
| 56 | + asset_path: ./llvm-static-libs.tar.gz |
| 57 | + asset_name: llvm-static-linux-amd64.tar.gz |
| 58 | + asset_content_type: application/gzip |
0 commit comments