Skip to content

workflows/release-documentation: Rework workflow to make it testable - #212689

Closed
tstellar wants to merge 30 commits into
llvm:users/tstellar/uses-self-contained-uploadfrom
tstellar:release-docs-testing
Closed

workflows/release-documentation: Rework workflow to make it testable#212689
tstellar wants to merge 30 commits into
llvm:users/tstellar/uses-self-contained-uploadfrom
tstellar:release-docs-testing

Conversation

@tstellar

@tstellar tstellar commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This includes several separate changes for the workflow, which were necessary to get the testing to pass:

  • Merged release-man-pages-validate-input into the release-documentation job.
  • Split the release note uploading into a separate job.
  • Moved the environment declaration to the
  • Stopped forcing clang as the compiler in build-docs.sh script. This was causing the runtimes build to fail, because the default Ubuntu debian packages for clang where not providing all the necessary CMake files. It seems that when you use clang as the compiler, the runtimes try to use the cmake files installed along with it.

@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-github-workflow

Author: Tom Stellard (tstellar)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/212689.diff

1 Files Affected:

  • (modified) .github/workflows/release-documentation.yml (+34-14)
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 }}

@tstellar
tstellar marked this pull request as draft July 29, 2026 05:53
@tstellar
tstellar marked this pull request as ready for review July 30, 2026 05:24
./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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs-build is now an artifact from a previous step that needs downloading?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed now.

Comment on lines +50 to +51
# 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does this happen?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now, good catch.

runs-on: ubuntu-24.04
needs:
- release-man-pages-validate-input
permissions:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems redundant with the top level permissions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed now.

.github/workflows/

- name: Check Permissions
uses: ./.github/workflows/require-team-membership

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we're never doing the permissions check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@tstellar
tstellar marked this pull request as draft July 30, 2026 16:27

@c-rhodes c-rhodes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM cheers

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

🐧 Linux x64 Test Results

  • 201382 tests passed
  • 5520 tests skipped

✅ The build succeeded and all tests passed.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

🪟 Windows x64 Test Results

  • 139312 tests passed
  • 3618 tests skipped

✅ The build succeeded and all tests passed.

tstellar added 16 commits July 31, 2026 14:38
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.
@tstellar
tstellar force-pushed the release-docs-testing branch from fa22bc7 to b1787e3 Compare August 4, 2026 04:51
@tstellar
tstellar changed the base branch from main to users/tstellar/uses-self-contained-upload August 4, 2026 04:53
@tstellar
tstellar force-pushed the release-docs-testing branch from b1787e3 to b11533f Compare August 4, 2026 04:55
@tstellar
tstellar force-pushed the users/tstellar/uses-self-contained-upload branch from 2c6f0d8 to 2b6ed08 Compare August 5, 2026 17:45
@tstellar
tstellar deleted the branch llvm:users/tstellar/uses-self-contained-upload August 5, 2026 18:06
@tstellar tstellar closed this Aug 5, 2026
@tstellar

tstellar commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

I accidentally closed this while experimenting with stacked PRs. New PR is here: #214304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants