10 description: 'Upload binaries to the release page'
15 description: 'Tag to build'
20 contents: read # Default everything to read-only
24 name: Prepare to build binaries
26 if: github.repository == 'llvm/llvm-project'
28 release-version: ${{ steps.validate-tag.outputs.release-version }}
29 release: ${{ steps.validate-tag.outputs.release }}
30 build-dir: ${{ steps.validate-tag.outputs.build-dir }}
31 rc-flags: ${{ steps.validate-tag.outputs.rc-flags }}
32 ref: ${{ steps.validate-tag.outputs.ref }}
33 upload: ${{ steps.validate-tag.outputs.upload }}
37 uses: actions/checkout@v4
39 - name: Validate and parse tag
41 # In order for the test-release.sh script to run correctly, the LLVM
42 # source needs to be at the following location relative to the build dir:
43 # | X.Y.Z-rcN | ./rcN/llvm-project
44 # | X.Y.Z | ./final/llvm-project
46 # We also need to set divergent flags based on the release version:
47 # | X.Y.Z-rcN | -rc N -test-asserts
50 tag="${{ github.ref_name }}"
51 trimmed=$(echo ${{ inputs.tag }} | xargs)
52 [[ "$trimmed" != "" ]] && tag="$trimmed"
53 if [ -n "${{ inputs.upload }}" ]; then
54 upload="${{ inputs.upload }}"
58 bash .github/workflows/set-release-binary-outputs.sh "${{ github.actor }}" "$tag" "$upload"
61 name: ${{ matrix.target.triple }}
63 contents: write # To upload assets to release.
65 runs-on: ${{ matrix.target.runs-on }}
70 - triple: x86_64-linux-gnu-ubuntu-22.04
71 runs-on: ubuntu-22.04-16x64
79 uses: actions/checkout@v4
81 ref: ${{ needs.prepare.outputs.ref }}
82 path: ${{ needs.prepare.outputs.build-dir }}/llvm-project
84 - name: Install Brew build dependencies
85 if: matrix.target.brew-build-deps != ''
86 run: brew install ${{ matrix.target.brew-build-deps }}
88 - name: Install Debian build dependencies
89 if: matrix.target.debian-build-deps != ''
90 run: sudo apt install ${{ matrix.target.debian-build-deps }}
92 - name: Set macOS build env variables
93 if: runner.os == 'macOS'
95 echo "MACOSX_DEPLOYMENT_TARGET=10.9" >> "$GITHUB_ENV"
97 - name: Build and test release
99 ${{ needs.prepare.outputs.build-dir }}/llvm-project/llvm/utils/release/test-release.sh \
100 -release ${{ needs.prepare.outputs.release }} \
101 ${{ needs.prepare.outputs.rc-flags }} \
102 -triple ${{ matrix.target.triple }} \
107 - name: Upload binaries
108 if: ${{ always() && needs.prepare.outputs.upload == 'true' }}
110 sudo apt install python3-github
111 ${{ needs.prepare.outputs.build-dir }}/llvm-project/llvm/utils/release/github-upload-release.py \
112 --token ${{ github.token }} \
113 --release ${{ needs.prepare.outputs.release-version }} \
115 --files ${{ needs.prepare.outputs.build-dir }}/clang+llvm-${{ needs.prepare.outputs.release-version }}-${{ matrix.target.triple }}.tar.xz