-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workflows: Refactor release-tasks.yml (#69523)
* Split out the lit release job and the documentation build job into their own workflow files. This makes it possible to manually run these jobs via workflow_dispatch. * Improve tag/user validation and ensure it gets run for each release task.
- Loading branch information
Showing
7 changed files
with
331 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Release Documentation | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release-version: | ||
description: 'Release Version' | ||
required: true | ||
type: string | ||
upload: | ||
description: 'Upload documentation' | ||
required: false | ||
type: boolean | ||
|
||
workflow_call: | ||
inputs: | ||
release-version: | ||
description: 'Release Version' | ||
required: true | ||
type: string | ||
upload: | ||
description: 'Upload documentation' | ||
required: false | ||
type: boolean | ||
|
||
jobs: | ||
release-documentation: | ||
name: Build and Upload Release Documentation | ||
runs-on: ubuntu-latest | ||
env: | ||
upload: ${{ inputs.upload && !contains(inputs.release-version, 'rc') }} | ||
steps: | ||
- name: Checkout LLVM | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Setup Python env | ||
uses: actions/setup-python@v4 | ||
with: | ||
cache: 'pip' | ||
cache-dependency-path: './llvm/docs/requirements.txt' | ||
|
||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
graphviz \ | ||
python3-github \ | ||
ninja-build \ | ||
texlive-font-utils | ||
pip3 install --user -r ./llvm/docs/requirements.txt | ||
- name: Build Documentation | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
./llvm/utils/release/build-docs.sh -release "${{ inputs.release-version }}" -no-doxygen | ||
- name: Create Release Notes Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: release-notes | ||
path: docs-build/html-export/ | ||
|
||
- name: Clone www-releases | ||
if: env.upload | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
repository: ${{ github.repository_owner }}/www-releases | ||
ref: main | ||
fetch-depth: 0 | ||
path: www-releases | ||
|
||
- name: Upload Release Notes | ||
if: env.upload | ||
env: | ||
WWW_RELEASES_TOKEN: ${{ secrets.WWW_RELEASES_TOKEN }} | ||
run: | | ||
mkdir -p ../www-releases/${{ inputs.release-version }} | ||
mv ./docs-build/html-export/* ../www-releases/${{ inputs.release-version }} | ||
cd ../www-releases | ||
git add ${{ inputs.release-version }} | ||
git config user.email "[email protected]" | ||
git config user.name "llvmbot" | ||
git commit -a -m "Add ${{ inputs.release-version }} documentation" | ||
git push "https://[email protected]/${{ github.repository_owner }}/www-releases" main:main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Release Doxygen | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release-version: | ||
description: 'Release Version' | ||
required: true | ||
type: string | ||
upload: | ||
description: 'Upload documentation' | ||
required: false | ||
type: boolean | ||
|
||
workflow_call: | ||
inputs: | ||
release-version: | ||
description: 'Release Version' | ||
required: true | ||
type: string | ||
upload: | ||
description: 'Upload documentation' | ||
required: false | ||
type: boolean | ||
|
||
jobs: | ||
release-doxygen: | ||
name: Build and Upload Release Doxygen | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
env: | ||
upload: ${{ inputs.upload && !contains(inputs.release-version, 'rc') }} | ||
steps: | ||
- name: Checkout LLVM | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Setup Python env | ||
uses: actions/setup-python@v4 | ||
with: | ||
cache: 'pip' | ||
cache-dependency-path: './llvm/docs/requirements.txt' | ||
|
||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
doxygen \ | ||
graphviz \ | ||
python3-github \ | ||
ninja-build \ | ||
texlive-font-utils | ||
pip3 install --user -r ./llvm/docs/requirements.txt | ||
- name: Build Doxygen | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
./llvm/utils/release/build-docs.sh -release "${{ inputs.release-version }}" -no-sphinx | ||
- name: Upload Doxygen | ||
if: env.upload | ||
run: | | ||
./llvm/utils/release/github-upload-release.py --token "$GITHUB_TOKEN" --release "${{ inputs.release-version }}" --user "${{ github.actor }}" upload --files ./*doxygen*.tar.xz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Release Lit | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release-version: | ||
description: 'Release Version' | ||
required: true | ||
type: string | ||
|
||
workflow_call: | ||
inputs: | ||
release-version: | ||
description: 'Release Version' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
release-lit: | ||
name: Release Lit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout LLVM | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
ref: "llvmorg-${{ inputs.release-version }}" | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y python3-setuptools python3-psutil python3-github | ||
- name: Check Permissions | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --user ${{ github.actor }} check-permissions | ||
- name: Setup Cpp | ||
uses: aminya/setup-cpp@v1 | ||
with: | ||
compiler: llvm-16.0.6 | ||
cmake: true | ||
ninja: true | ||
|
||
- name: Test lit | ||
run: | | ||
mkdir build && cd build | ||
export FILECHECK_OPTS='-dump-input-filter=all -vv -color' | ||
cmake ../llvm -DCMAKE_BUILD_TYPE=Release -G Ninja | ||
ninja -v -j $(nproc) check-lit | ||
- name: Package lit | ||
run: | | ||
cd llvm/utils/lit | ||
# Remove 'dev' suffix from lit version. | ||
sed -i 's/ + "dev"//g' lit/__init__.py | ||
python3 setup.py sdist | ||
- name: Upload lit to test.pypi.org | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.LLVM_LIT_TEST_PYPI_API_TOKEN }} | ||
repository-url: https://test.pypi.org/legacy/ | ||
packages-dir: llvm/utils/lit/dist/ | ||
|
||
- name: Upload lit to pypi.org | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.LLVM_LIT_PYPI_API_TOKEN }} | ||
packages-dir: llvm/utils/lit/dist/ |
Oops, something went wrong.