[MLGO] Remove unsupported tag from BB profile dump test
[llvm-project.git] / .github / workflows / release-tasks.yml
blob5604b48857dbe25d7cb553b4675722cbdb2a106e
1 name: Release Task
3 permissions:
4   contents: read
6 on:
7   push:
8     tags:
9       # The regex support here is limited, so just match everything that starts with llvmorg- and filter later.
10       - 'llvmorg-*'
12 jobs:
13   release-tasks:
14     permissions:
15       contents: write # To upload assets to release.
16     runs-on: ubuntu-latest
17     if: github.repository == 'llvm/llvm-project'
18     steps:
19       - name: Validate Tag
20         id: validate-tag
21         run: |
22           test "${{ github.actor }}" = "tstellar" || test "${{ github.actor }}" = "tru"
23           echo "${{ github.ref_name }}" | grep -e '^llvmorg-[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc[0-9]\+\)\?$'
24           release_version=$(echo "${{ github.ref_name }}" | sed 's/llvmorg-//g')
25           echo "release-version=$release_version" >> $GITHUB_OUTPUT
27       - name: Install Dependencies
28         run: |
29           sudo apt-get update
30           sudo apt-get install -y \
31               doxygen \
32               graphviz \
33               python3-github \
34               python3-recommonmark \
35               python3-sphinx \
36               ninja-build \
37               texlive-font-utils
38           pip3 install --user sphinx-markdown-tables
40       - name: Checkout LLVM
41         uses: actions/checkout@v3
43       - name: Create Release
44         run: |
45           ./llvm/utils/release/./github-upload-release.py --token ${{ github.token }} --release ${{ steps.validate-tag.outputs.release-version }} create
47       - name: Build Documentation
48         run: |
49           ./llvm/utils/release/build-docs.sh -release ${{ steps.validate-tag.outputs.release-version }}
50           ./llvm/utils/release/github-upload-release.py --token ${{ github.token }} --release ${{ steps.validate-tag.outputs.release-version }} upload --files *doxygen*.tar.xz
52       - name: Create Release Notes Artifact
53         uses: actions/download-artifact@v3
54         with:
55           name: release-notes
56           path: docs-build/html-export/
58       - name: Clone www-releases
59         if: ${{ !contains(steps.validate-tag.outputs.release-version, 'rc') }}
60         uses: actions/checkout@v3
61         with:
62           repository: ${{ github.repository_owner }}/www-releases
63           ref: main
64           fetch-depth: 0
65           path: www-releases
67       - name: Upload Release Notes
68         if: ${{ !contains(steps.validate-tag.outputs.release-version, 'rc') }}
69         run: |
70           mkdir -p ../www-releases/${{ steps.validate-tag.outputs.release-version }}
71           mv ./docs-build/html-export/* ../www-releases/${{ steps.validate-tag.outputs.release-version }}
72           cd ../www-releases
73           git add ${{ steps.validate-tag.outputs.release-version }}
74           git config user.email "llvmbot@llvm.org"
75           git config user.name "llvmbot"
76           git commit -a -m "Add ${{ steps.validate-tag.outputs.release-version }} documentation"
77           git push https://${{ secrets.WWW_RELEASES_TOKEN }}@github.com/${{ github.repository_owner }}/www-releases main:main
79   release-lit:
80     runs-on: ubuntu-latest
81     if: github.repository == 'llvm/llvm-project'
82     steps:
83       - name: Checkout LLVM
84         uses: actions/checkout@v3
86       - name: Install dependencies
87         run: sudo apt-get install -y python3-setuptools
89       - name: Test lit
90         run: |
91           cd llvm/utils/lit
92           python3 lit.py tests
94       - name: Package lit
95         run: |
96           cd llvm/utils/lit
97           # Remove 'dev' suffix from lit version.
98           sed -i "s/ + 'dev'//g" lit/__init__.py
99           python3 setup.py sdist
101       - name: Upload lit to test.pypi.org
102         uses: pypa/gh-action-pypi-publish@release/v1
103         with:
104           password: ${{ secrets.LLVM_LIT_TEST_PYPI_API_TOKEN }}
105           repository-url: https://test.pypi.org/legacy/
107       - name: Upload lit to pypi.org
108         uses: pypa/gh-action-pypi-publish@release/v1
109         with:
110           password: ${{ secrets.LLVM_LIT_PYPI_API_TOKEN }}