Skip to content

Add automated release workflows for the jsdoc and tracking-jsdoc packages#232

Merged
eason9487 merged 7 commits into
trunkfrom
add/js-packages-release
Jun 11, 2026
Merged

Add automated release workflows for the jsdoc and tracking-jsdoc packages#232
eason9487 merged 7 commits into
trunkfrom
add/js-packages-release

Conversation

@eason9487

Copy link
Copy Markdown
Member

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:

  • Add release-notes-config.yml for both jsdoc and tracking-jsdoc, each with its own package-specific label prefix.
  • Add three shared workflows for the JS packages:
    • js-packages-prepare-release.yml: triggered when a release/jsdoc or release/tracking-jsdoc branch is created. It generates the changelog, updates the version in package.json (and package-lock.json when 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.
  • Add js-packages-create-and-commit-build.sh to build the flat release tree without any npm or PHP build steps. It follows the process of the github-actions build script.
  • Add release process docs to both package READMEs.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.yml files 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.

Comment thread .github/workflows/js-packages-release.yml
Comment on lines +53 to +58
const artifact = artifacts.find( ( el ) => el.name === 'release' );
const download = await github.rest.actions.downloadArtifact( {
...context.repo,
artifact_id: artifact.id,
archive_format: 'zip',
} );

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Comment on lines +54 to +60
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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Comment thread packages/js/jsdoc/README.md Outdated
Comment thread packages/js/tracking-jsdoc/README.md Outdated
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)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment on lines +28 to +38
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,
} );
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Comment thread packages/js/tracking-jsdoc/README.md
Comment thread packages/js/jsdoc/README.md
@eason9487 eason9487 merged commit aef8f56 into trunk Jun 11, 2026
17 checks passed
@eason9487 eason9487 deleted the add/js-packages-release branch June 11, 2026 06:50
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.

2 participants