[IRBuilder] Refactor FMF interface (#121657)
[llvm-project.git] / .github / workflows / release-documentation.yml
blob922c5093f13579dd6db5af764fb712e539d7a064
1 name: Release Documentation
3 permissions:
4   contents: read
6 on:
7   workflow_dispatch:
8     inputs:
9       release-version:
10         description: 'Release Version'
11         required: true
12         type: string
13       upload:
14         description: 'Upload documentation'
15         required: false
16         type: boolean
18   workflow_call:
19     inputs:
20       release-version:
21         description: 'Release Version'
22         required: true
23         type: string
24       upload:
25         description: 'Upload documentation'
26         required: false
27         type: boolean
29 jobs:
30   release-documentation:
31     name: Build and Upload Release Documentation
32     runs-on: ubuntu-latest
33     env:
34       upload: ${{ inputs.upload && !contains(inputs.release-version, 'rc') }}
35     steps:
36       - name: Checkout LLVM
37         uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
39       - name: Setup Python env
40         uses: actions/setup-python@v5
41         with:
42           cache: 'pip'
43           cache-dependency-path: './llvm/docs/requirements.txt'
45       - name: Install Dependencies
46         run: |
47           sudo apt-get update
48           sudo apt-get install -y \
49               graphviz \
50               python3-github \
51               ninja-build \
52               texlive-font-utils
53           pip3 install --user -r ./llvm/docs/requirements.txt
55       - name: Build Documentation
56         env:
57           GITHUB_TOKEN: ${{ github.token }}
58         run: |
59           ./llvm/utils/release/build-docs.sh -release "${{ inputs.release-version }}" -no-doxygen
61       - name: Create Release Notes Artifact
62         uses: actions/upload-artifact@v3
63         with:
64           name: release-notes
65           path: docs-build/html-export/
67       - name: Clone www-releases
68         if: env.upload
69         uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
70         with:
71           repository: ${{ github.repository_owner }}/www-releases
72           ref: main
73           fetch-depth: 0
74           path: www-releases
75           persist-credentials: false
77       - name: Upload Release Notes
78         if: env.upload
79         env:
80           GH_TOKEN: ${{ secrets.WWW_RELEASES_TOKEN }}
81         run: |
82           mkdir -p www-releases/${{ inputs.release-version }}
83           mv ./docs-build/html-export/* www-releases/${{ inputs.release-version }}
84           cd www-releases
85           git checkout -b ${{ inputs.release-version }}
86           git add ${{ inputs.release-version }}
87           git config user.email "llvmbot@llvm.org"
88           git config user.name "llvmbot"
89           git commit -a -m "Add ${{ inputs.release-version }} documentation"
90           git push --force  "https://$GH_TOKEN@github.com/llvmbot/www-releases.git" HEAD:refs/heads/${{ inputs.release-version }}
91           gh pr create -f -B main -H ${{ inputs.release-version }} -R llvmbot/www-releases