|
| 1 | +name: Darwin LLVM build |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + logLevel: |
| 7 | + description: 'Log level' |
| 8 | + required: false |
| 9 | + default: 'warn' |
| 10 | + type: choice |
| 11 | + options: |
| 12 | + - info |
| 13 | + - warn |
| 14 | + - debug |
| 15 | + push: |
| 16 | + branches: |
| 17 | + - '*build-llvm*' |
| 18 | + |
| 19 | +concurrency: |
| 20 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 21 | + cancel-in-progress: true |
| 22 | + |
| 23 | +env: |
| 24 | + LLVM_VERSION: 15.0.7 |
| 25 | + MACOSX_DEPLOYMENT_TARGET: 10.11 |
| 26 | + LOG_LEVEL: ${{ inputs.logLevel || 'warn' }} |
| 27 | + |
| 28 | +jobs: |
| 29 | + llvm-build: |
| 30 | + runs-on: macos-11 |
| 31 | + defaults: |
| 32 | + run: |
| 33 | + working-directory: ./omnibus |
| 34 | + |
| 35 | + steps: |
| 36 | + - name: Select Xcode |
| 37 | + uses: maxim-lobanov/setup-xcode@v1 |
| 38 | + with: |
| 39 | + xcode-version: '13.2.1' |
| 40 | + |
| 41 | + - name: Download sources |
| 42 | + uses: actions/checkout@v4 |
| 43 | + |
| 44 | + - name: Update development environment |
| 45 | + run: | |
| 46 | + brew update |
| 47 | + brew install --display-times pkgconfig libtool cmake |
| 48 | +
|
| 49 | + - name: Prepare folders |
| 50 | + run: | |
| 51 | + sudo mkdir -p /opt/llvm |
| 52 | + sudo chown $(whoami) /opt/llvm/ |
| 53 | + sudo mkdir -p /var/cache |
| 54 | + sudo chown $(whoami) /var/cache |
| 55 | +
|
| 56 | + - name: Install omnibus |
| 57 | + run: bundle check || bundle install |
| 58 | + |
| 59 | + - name: Build llvm |
| 60 | + run: bundle exec omnibus build llvm --log-level ${{ env.LOG_LEVEL }} --override use_git_caching:false |
| 61 | + |
| 62 | + # Reference: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files |
| 63 | + - name: Extract the package name to be used for the artifact name |
| 64 | + run: | |
| 65 | + cd pkg |
| 66 | + filename=$(ls -1 llvm-*.tar.gz) |
| 67 | + echo "ARTIFACT_NAME=${filename%.tar.gz}" >> "$GITHUB_ENV" |
| 68 | +
|
| 69 | + # When an Artifact is uploaded, all the files are assembled into an immutable Zip archive. |
| 70 | + # https://github.com/actions/upload-artifact#zip-archives |
| 71 | + - name: Upload artifact |
| 72 | + uses: actions/upload-artifact@v4 |
| 73 | + with: |
| 74 | + name: ${{ env.ARTIFACT_NAME }} |
| 75 | + path: omnibus/pkg/*.tar.gz |
| 76 | + retention-days: 1 |
| 77 | + if-no-files-found: error |
| 78 | + compression-level: 0 # package is already compressed |
0 commit comments