10 description: Release Version
16 description: Release Version
20 RELEASE_TASKS_USER_TOKEN:
21 description: "Secret used to check user permissions."
23 # Run on pull_requests for testing purposes.
26 - '.github/workflows/release-sources.yml'
31 # When a PR is closed, we still start this workflow, but then skip
32 # all the jobs, which makes it effectively a no-op. The reason to
33 # do this is that it allows us to take advantage of concurrency groups
34 # to cancel in progress CI jobs whenever the PR is closed.
38 group: ${{ github.workflow }}-${{ inputs.release-version || github.event.pull_request.number }}
39 cancel-in-progress: True
43 name: Collect Job Inputs
45 github.repository_owner == 'llvm' &&
46 github.event.action != 'closed'
48 ref: ${{ steps.inputs.outputs.ref }}
49 export-args: ${{ steps.inputs.outputs.export-args }}
50 runs-on: ubuntu-latest
54 ref=${{ (inputs.release-version && format('llvmorg-{0}', inputs.release-version)) || github.sha }}
55 if [ -n "${{ inputs.release-version }}" ]; then
56 export_args="-release ${{ inputs.release-version }} -final"
58 export_args="-git-ref ${{ github.sha }}"
60 echo "ref=$ref" >> $GITHUB_OUTPUT
61 echo "export-args=$export_args" >> $GITHUB_OUTPUT
64 name: Package Release Sources
65 if: github.repository_owner == 'llvm'
66 runs-on: ubuntu-latest
74 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
76 ref: ${{ needs.inputs.outputs.ref }}
78 - name: Install Dependencies
80 pip install --require-hashes -r ./llvm/utils/git/requirements.txt
82 - name: Check Permissions
83 if: github.event_name != 'pull_request'
85 GITHUB_TOKEN: ${{ github.token }}
86 USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
88 ./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --user ${{ github.actor }} --user-token "$USER_TOKEN" check-permissions
89 - name: Create Tarballs
91 ./llvm/utils/release/export.sh ${{ needs.inputs.outputs.export-args }}
92 - name: Attest Build Provenance
93 if: github.event_name != 'pull_request'
95 uses: actions/attest-build-provenance@897ed5eab6ed058a474202017ada7f40bfa52940 # v1.0.0
98 - if: github.event_name != 'pull_request'
100 mv ${{ steps.provenance.outputs.bundle-path }} .
101 - name: Create Tarball Artifacts
102 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3