Skip to content

chore: show release version before publish approval - #10648

Merged
lizschwab merged 4 commits into
RaspberryPiFoundation:mainfrom
ritfiz:chore/publish-version-preview
Nov 3, 2026
Merged

lizschwab merged 4 commits into
RaspberryPiFoundation:mainfrom
ritfiz:chore/publish-version-preview

Conversation

@ritfiz

@ritfiz ritfiz commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #10426

Proposed Changes

Adds a preview job to the publish workflow that runs between ci and publish, before the release environment approval.

  • preview works out the dist-tag and builds the lerna version command (same logic as before, moved out of publish), nothing is committed, tagged or pushed.
  • It shows the result as a notice on the run page, and adds the same line to the run summary. Approvers see this while publish is waiting for approval.
Screenshot 2026-11-01 224910

Reason for Changes

Before #10231, a separate version job ran before the gated publish job and printed the version, so approvers could check it before approving. #10231 moved versioning into the gated job (lerna versions, commits and tags in one command), so the version only appeared after approval. For example, in the 13.4.0 release run the version first appears a few minutes after publish was approved, compared with the 13.2.1 release run where it was printed before.

This keeps #10231's goal of using a single version command for dry runs and real releases, and brings back the check before approval.

Test Coverage

Tested on my fork with a dry run from a non-default branch: run 41325662213. ci passed, preview showed blockly 13.4.0 => 13.4.1-beta.0 on dist-tag beta, and publish was skipped.

Screenshot 2026-11-01 222317

Documentation

None needed.

Move version calculation into a preview job that runs before the
publish job's release environment approval, and show the version and
dist-tag on the run page so approvers can check them first. The
preview job is also the whole of a dry run, and it runs on forks so
the workflow can be tested there.

The publish job reuses the preview's version command, so the version
shown is worked out the same way as the one that is published.
@ritfiz
ritfiz requested a review from a team as a code owner November 1, 2026 17:16
@ritfiz
ritfiz requested a review from zspriggs November 1, 2026 17:16
@github-actions github-actions Bot added the PR: chore General chores (dependencies, typos, etc) label Nov 1, 2026
@github-actions github-actions Bot added PR: chore General chores (dependencies, typos, etc) and removed PR: chore General chores (dependencies, typos, etc) labels Nov 1, 2026
# Works out the version and dist-tag without committing or publishing, so the
# person approving the publish job can check them first. This is also the
# whole of a dry run.
preview:

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 new job to show the preview

environment: release
permissions:
contents: read
outputs:

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.

passing the dist tag and version command to publish

if: ${{ !inputs.skip_versioning }}
# The publish job runs this exact command, so the version shown here is
# the version that gets published.
- name: Build version command

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.

an example of produced command - npx lerna version --conventional-prerelease --preid beta --ignore-scripts --force-publish --conventional-commits --yes

Record the commit the preview ran on and check it again in the publish job, so the version shown before approval is the one released. Also drop step-level dry_run checks, since the publish job no longer runs on dry runs.
echo "version_command=${VERSION_COMMAND}" >> "$GITHUB_OUTPUT"
echo "${VERSION_COMMAND}"

- name: Preview version

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.

running the command to get the version without pushing anything

needs: preview
runs-on: ubuntu-latest
# Don't try to publish from a fork of RaspberryPiFoundation/blockly.
if: ${{ !inputs.dry_run && github.repository_owner == 'RaspberryPiFoundation' }}

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.

Not running publish on dry run, so we can remove the checks of !inputs.dry_run from other steps within this job

PREVIEW_SHA: ${{ needs.preview.outputs.sha }}
run: |
HEAD_SHA=$(git rev-parse HEAD)
if [ "${HEAD_SHA}" != "${PREVIEW_SHA}" ]; then

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.

check to ensure that nothing else was merged while waiting for publish approval. basically the preview version and published version should match

@lizschwab lizschwab 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.

Overall this looks fine. I tested out the bash scripts locally with various inputs and everything seems to be working correctly. I'm going to approve this right now and then tomorrow I will run a test beta publish to make sure it's working correctly. We won't test the "latest" dist tag scenario until we're ready for a true release.

Changed the lerna loglevel from silly to warn
@lizschwab
lizschwab merged commit b13be15 into RaspberryPiFoundation:main Nov 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: chore General chores (dependencies, typos, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display version numbers before publish step

3 participants