workflows/release-documentation: Rework workflow to make it testable - #212689
workflows/release-documentation: Rework workflow to make it testable#212689tstellar wants to merge 30 commits into
Conversation
|
@llvm/pr-subscribers-github-workflow Author: Tom Stellard (tstellar) ChangesRemoved the environment declaration from the validation job and split out the www-releases update into a separate job. This makes it safe and possible to add a pull_request trigger so we can at least test building the documentation when someone submits a pull request. Full diff: https://github.com/llvm/llvm-project/pull/212689.diff 1 Files Affected:
diff --git a/.github/workflows/release-documentation.yml b/.github/workflows/release-documentation.yml
index a39d4dba87a5a..6ee08cb48a95f 100644
--- a/.github/workflows/release-documentation.yml
+++ b/.github/workflows/release-documentation.yml
@@ -38,6 +38,24 @@ on:
LLVM_TOKEN_GENERATOR_PRIVATE_KEY:
description: "Private key for our GitHub App we use for generating access tokens."
required: true
+ # Run on pull_requests for testing purposes.
+ pull_request:
+ paths:
+ - '.github/workflows/release-documentation.yml'
+ - 'llvm/utils/release/build-docs.sh'
+ types:
+ - opened
+ - synchronize
+ - reopened
+ # When a PR is closed, we still start this workflow, but then skip
+ # all the jobs, which makes it effectively a no-op. The reason to
+ # do this is that it allows us to take advantage of concurrency groups
+ # to cancel in progress CI jobs whenever the PR is closed.
+ - closed
+
+concurrency:
+ group: ${{ github.workflow }}-${{ inputs.release-version || github.event.pull_request.number }}
+ cancel-in-progress: True
jobs:
# This job checks permissions and validates inputs to prevent potential
@@ -47,9 +65,6 @@ jobs:
release-man-pages-validate-input:
name: Release Man Pages Validate Input
runs-on: ubuntu-24.04
- environment:
- name: release
- deployment: false
permissions:
contents: read
steps:
@@ -59,13 +74,6 @@ jobs:
sparse-checkout: |
.github/workflows/
- - name: Check Permissions
- uses: ./.github/workflows/require-team-membership
- with:
- team-slug: llvm-release-managers
- LLVM_TOKEN_GENERATOR_CLIENT_ID: ${{ secrets.LLVM_TOKEN_GENERATOR_CLIENT_ID }}
- LLVM_TOKEN_GENERATOR_PRIVATE_KEY: ${{ secrets.LLVM_TOKEN_GENERATOR_PRIVATE_KEY }}
-
- name: Validate Input
uses: ./.github/workflows/validate-release-version
with:
@@ -84,8 +92,6 @@ jobs:
man-page-tarball-name: ${{ steps.vars.outputs.man-page-tarball-name }}
man-page-upload: ${{ steps.vars.outputs.man-page-upload }}
man-page-attestation-name: ${{ steps.vars.outputs.man-page-attestation-name }}
- env:
- upload: ${{ inputs.upload && !contains(inputs.release-version, 'rc') }}
steps:
- name: Collect Variables
id: vars
@@ -155,8 +161,23 @@ jobs:
name: release-notes
path: docs-build/html-export/
+
+ upload-release-notes:
+ name: "Upload Release Notes"
+ runs-on: ubuntu-24.04
+ environment:
+ deployment: false
+ name: release
+ needs:
+ - release-documentation
+ if: >-
+ github.event_name != 'pull_request' &&
+ inputs.upload &&
+ !contains(inputs.release-version, 'rc')
+ permissions:
+ contents: read
+ steps:
- name: Clone www-releases
- if: env.upload
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
repository: ${{ github.repository_owner }}/www-releases
@@ -166,7 +187,6 @@ jobs:
persist-credentials: false
- name: Upload Release Notes
- if: env.upload
env:
PUSH_TOKEN: ${{ secrets.LLVMBOT_WWW_RELEASES_PUSH }}
GH_TOKEN: ${{ secrets.WWW_RELEASES_TOKEN }}
|
| ./llvm/utils/release/build-docs.sh -release "$INPUTS_RELEASE_VERSION" -no-doxygen | ||
| ./llvm/utils/release/build-docs.sh \ | ||
| $(test -n "$INPUTS_RELEASE_VERSION" && echo -release $INPUTS_RELEASE_VERSION || echo -srcdir llvm) -no-doxygen | ||
| echo "man-page-tarball-name=$(basename $(find . -iname 'llvm_man_pages-*'))" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
https://github.com/llvm/llvm-project/actions/runs/30501993198/job/90743436887
2026-07-30T00:22:50.8870443Z ##[group]Run echo "man-page-digest=$(cat "$TARBALL_NAME" | sha256sum | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
2026-07-30T00:22:50.8871446Z �[36;1mecho "man-page-digest=$(cat "$TARBALL_NAME" | sha256sum | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT�[0m
2026-07-30T00:22:50.8921486Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2026-07-30T00:22:50.8921825Z env:
2026-07-30T00:22:50.8922068Z TARBALL_NAME: llvm_man_pages-24.0.0-g24e68b69762880
2026-07-30T00:22:50.8922385Z ##[endgroup]
2026-07-30T00:22:50.9001040Z cat: llvm_man_pages-24.0.0-g24e68b69762880: Is a directory
looks like this is matching the directory instead of the tarball
There was a problem hiding this comment.
This should be fixed now.
There was a problem hiding this comment.
docs-build is now an artifact from a previous step that needs downloading?
There was a problem hiding this comment.
This should be fixed now.
| # When a PR is closed, we still start this workflow, but then skip | ||
| # all the jobs, which makes it effectively a no-op. The reason to |
There was a problem hiding this comment.
Fixed now, good catch.
| runs-on: ubuntu-24.04 | ||
| needs: | ||
| - release-man-pages-validate-input | ||
| permissions: |
There was a problem hiding this comment.
This seems redundant with the top level permissions?
There was a problem hiding this comment.
This is fixed now.
| .github/workflows/ | ||
|
|
||
| - name: Check Permissions | ||
| uses: ./.github/workflows/require-team-membership |
There was a problem hiding this comment.
Now we're never doing the permissions check?
There was a problem hiding this comment.
The upload-man-pages job has a permission check as part of the upload-release-artifact composite action. I don't think we need permission checks for anything else. Building the docs should be safe and even the release notes uploading, all that does is create a pull request, which shouldn't be an issue, but please take a look in case I'm missing something.
🐧 Linux x64 Test Results
✅ The build succeeded and all tests passed. |
🪟 Windows x64 Test Results
✅ The build succeeded and all tests passed. |
The action now checks out its own files so calling worklfows don't need to do this. This helps prevent mistakes where the calling workflow does not checkout the right files causing this action to fail.
…-artifact The workflow is on self-contained and checks out its own scripts, so we don't need to do this in the calling workflow. The '$' prefix in the uses tag tells github actions to load the action from the repository directly rather than searching for it on the local file system. https://github.blog/changelog/2026-07-30-reference-same-repository-actions-with-self-repository-syntax/
Removed the environment declaration from the validation job and split out the www-releases update into a separate job. This makes it safe and possible to add a pull_request trigger so we can at least test building the documentation when someone submits a pull request.
This reverts commit a5d98fb.
This reverts commit 028443c.
This reverts commit f90c6dd.
This reverts commit 1794326.
This reverts commit ef443b1.
fa22bc7 to
b1787e3
Compare
b1787e3 to
b11533f
Compare
2c6f0d8 to
2b6ed08
Compare
|
I accidentally closed this while experimenting with stacked PRs. New PR is here: #214304 |
This includes several separate changes for the workflow, which were necessary to get the testing to pass: