Add automated release workflows for the jsdoc and tracking-jsdoc packages#232
Conversation
Add release-notes-config.yml for jsdoc and tracking-jsdoc packages with package-specific label prefixes for changelog categorization.
Add js-packages-prepare-release.yml triggered by release/jsdoc and release/tracking-jsdoc branches. Derives package config from branch name, generates changelog via get-release-notes released action, updates version files, and creates a release PR.
Add js-packages-create-release.yml triggered by PR approval on release/jsdoc or release/tracking-jsdoc branches. Derives package config from branch name and creates a GitHub release via the shared create-release.mjs script.
Add js-packages-create-and-commit-build.sh and js-packages-release.yml for building flat release trees, updating version tags, and auto-merging release PRs for jsdoc and tracking-jsdoc packages.
There was a problem hiding this comment.
Pull request overview
This PR introduces automated GitHub Actions workflows and supporting config/docs to standardize releases for the packages/js/jsdoc and packages/js/tracking-jsdoc packages, as prep work for the upcoming Node.js v24 upgrade and smoother package publishing.
Changes:
- Added package-specific
release-notes-config.ymlfiles to generate categorized release notes using package-prefixed labels. - Added shared GitHub workflows to prepare a release PR, create a GitHub release on approval, and then build/tag/merge after release creation.
- Added a build script to generate a “flat” release tree and updated both package READMEs with release process documentation.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/js/tracking-jsdoc/release-notes-config.yml | Adds release-notes category configuration for tracking-jsdoc. |
| packages/js/tracking-jsdoc/README.md | Documents the new automated release process for tracking-jsdoc. |
| packages/js/jsdoc/release-notes-config.yml | Adds release-notes category configuration for jsdoc. |
| packages/js/jsdoc/README.md | Documents the new automated release process for jsdoc. |
| .github/workflows/js-packages-release.yml | Implements the post-release build/tag/merge workflow for JS packages. |
| .github/workflows/js-packages-prepare-release.yml | Implements the branch-create trigger workflow to generate changelog/version + open release PR. |
| .github/workflows/js-packages-create-release.yml | Creates a GitHub Release when the release PR is approved and uploads release metadata as an artifact. |
| .github/scripts/js-packages-create-and-commit-build.sh | Creates and commits a flattened release build tree for tagging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const artifact = artifacts.find( ( el ) => el.name === 'release' ); | ||
| const download = await github.rest.actions.downloadArtifact( { | ||
| ...context.repo, | ||
| artifact_id: artifact.id, | ||
| archive_format: 'zip', | ||
| } ); |
There was a problem hiding this comment.
This step is gated by if: github.event.workflow_run.conclusion == 'success', and the "JS Packages - Create Release" workflow always ends by uploading the release artifact. So whenever the run concludes successfully, the artifact should be present, which means artifact would not be undefined here in practice.
| with: | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
| package-dir: ${{ steps.config.outputs.package-dir }} | ||
| config-path: ${{ steps.config.outputs.config-path }} | ||
| tag-template: ${{ steps.config.outputs.tag-template }} | ||
| minor-keywords: feature, update, enhancement | ||
|
|
There was a problem hiding this comment.
The major-keywords input is intentionally omitted here so it falls back to the action default, which is "breaking", as defined in get-release-notes/action.yml. With that default, only the "Breaking Changes" heading matches the major level, so regular releases are not bumped to major.
Change "Create the branch ... onto the target revision" to "from" in both the jsdoc and tracking-jsdoc release docs, which reads correctly and is clearer about the branch direction. Address: - #232 (comment) - #232 (comment)
The edited trigger predates the flattened release build step. After the first run, update-version-tags moves the version tag onto the flattened build commit, so a later edited event would re-run the build against a tree without the package directory and fail. Keep published for manual releases and rely on workflow_run for the automated path. Address: - #232 (comment)
| const { payload, eventName } = context; | ||
| const tagReg = /^(jsdoc|tracking-jsdoc)-v(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-pre)?$/; | ||
| const failedWorkflowRun = eventName === 'workflow_run' && payload.workflow_run.conclusion !== 'success'; | ||
| const mismatchedTagName = eventName === 'release' && ! tagReg.test( payload.release.tag_name ); | ||
|
|
||
| if ( failedWorkflowRun || mismatchedTagName ) { | ||
| await github.rest.actions.cancelWorkflowRun( { | ||
| ...context.repo, | ||
| run_id: context.runId, | ||
| } ); | ||
| } |
There was a problem hiding this comment.
The automated release is created with the default GITHUB_TOKEN, and events from GITHUB_TOKEN do not start a new workflow run, so the release.published path is skipped and only workflow_run runs. The release.published path fires only for manual releases. Triggering both would take a deliberate bypass (such as using a PAT), which operators would not do in normal use.
Changes proposed in this Pull Request:
This PR is a preparatory step for the upcoming Node.js v24 upgrade.
To make it easier to automate the release of jsdoc packages, this PR:
release-notes-config.ymlfor bothjsdocandtracking-jsdoc, each with its own package-specific label prefix.js-packages-prepare-release.yml: triggered when arelease/jsdocorrelease/tracking-jsdocbranch is created. It generates the changelog, updates the version inpackage.json(andpackage-lock.jsonwhen present), and opens a release PR.js-packages-create-release.yml: triggered when the release PR is approved. It creates a GitHub release.js-packages-release.yml: triggered after the release is created. It builds the flat release tree, updates the version tags, and merges the release PR.js-packages-create-and-commit-build.shto build the flat release tree without any npm or PHP build steps. It follows the process of thegithub-actionsbuild script.