Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 15 additions & 46 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
pull-requests: write
issues: write
outputs:
staged: ${{ steps.changesets.outputs.staged }}
staged_packages: ${{ steps.changesets.outputs.staged_packages }}
staged: ${{ steps.release.outputs.staged }}
staged_packages: ${{ steps.release.outputs.staged_packages }}
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
Expand All @@ -54,27 +54,17 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# createGithubReleases stays off: a staged version isn't public until
# `promote` confirms npm approval, so nothing should announce it yet.
- name: Release
id: changesets
uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1
id: release
uses: kubb-labs/config/.github/actions/release@6498246dc71ad3c27db69f9cc1f928a05e79d0c7 # main
with:
version: pnpm exec changeset version
publish: 'node scripts/release.mjs'
commit: 'ci(changesets): version packages'
title: 'ci(changesets): version packages'
setupGitUser: false
createGithubReleases: false
env:
NPM_CONFIG_PROVENANCE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}

# Canary skips staging on purpose, so it stays automatic on every push.
# If the npm Trusted Publisher for these packages is ever locked to
# stage-only, this step will need its own non-stage-restricted entry.
- name: Publish canary
if: ${{ steps.changesets.outputs.staged != 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
if: ${{ steps.release.outputs.staged != 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
continue-on-error: true
shell: bash
env:
Expand Down Expand Up @@ -103,7 +93,7 @@ jobs:
permissions:
contents: write # gh release create
outputs:
approved: ${{ steps.verify.outputs.approved }}
approved: ${{ steps.promote.outputs.approved }}
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
Expand All @@ -116,38 +106,17 @@ jobs:
node-version: '22.22.3'
cache: 'false'

# A green environment review only means a maintainer clicked approve,
# not that they actually ran `npm stage approve`. This confirms the
# staged versions are really live on the registry before anything
# public fires.
- name: Verify staged versions are live on npm
id: verify
run: node scripts/verifyRegistry.mjs
env:
STAGED_PACKAGES: ${{ needs.release.outputs.staged_packages }}
# How often to re-poll npm while waiting for a staged version to
# propagate, and how many times to try before giving up.
VERIFY_INTERVAL_SECONDS: '300' # in seconds
VERIFY_RETRY_ATTEMPTS: '10'

# Tags are created here, not at stage time, so a rejected or expired
# staged package never leaves a dangling tag behind (see
# changesets/changesets#2025). The versions are already confirmed live
# above, so tagging now always points at something real.
- name: Tag released versions
run: |
pnpm exec changeset tag
git push --tags

# Every staged package gets its own release here, since packages in
# this repo version and changelog independently (see the empty `fixed`
# and `linked` groups in .changeset/config.json) — unlike kubb-labs/kubb,
# where every package shares one fixed version and one combined release.
- name: Create GitHub Releases
run: node scripts/createReleases.mjs
env:
STAGED_PACKAGES: ${{ needs.release.outputs.staged_packages }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# where every package shares one fixed version and one combined release,
# so this omits release-mode (defaults to per-package).
- name: Promote
id: promote
uses: kubb-labs/config/.github/actions/promote@6498246dc71ad3c27db69f9cc1f928a05e79d0c7 # main
with:
staged-packages: ${{ needs.release.outputs.staged_packages }}
github-token: ${{ secrets.GITHUB_TOKEN }}

deploy-platform:
name: Dispatch content-updated to platform
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ To approve a release:
2. The same maintainer approves the `promote` job's environment review on the workflow run in the Actions tab.
3. The `promote` job then verifies the versions are actually live on npm, tags the released versions, and creates a GitHub Release, and only then dispatches the content refresh to [kubb-labs/platform](https://github.com/kubb-labs/platform).

Packages in this repo version and changelog independently (see the empty `fixed` and `linked` groups in `.changeset/config.json`), so a release here creates one GitHub Release per staged package, tagged `<package>@<version>`, with notes taken from that package's own `CHANGELOG.md`. This differs from [kubb-labs/kubb](https://github.com/kubb-labs/kubb), where every package shares one fixed version and a release covers all of them combined. `scripts/createReleases.mjs` is shared verbatim between the two repos; the `RELEASE_MODE` environment variable picks the mode, and this repo simply never sets it to `combined`.
Packages in this repo version and changelog independently (see the empty `fixed` and `linked` groups in `.changeset/config.json`), so a release here creates one GitHub Release per staged package, tagged `<package>@<version>`, with notes taken from that package's own `CHANGELOG.md`. This differs from [kubb-labs/kubb](https://github.com/kubb-labs/kubb), where every package shares one fixed version and a release covers all of them combined. The `release` and `promote` steps come from the shared [kubb-labs/config](https://github.com/kubb-labs/config) actions (`.github/actions/release` and `.github/actions/promote`); this repo simply never sets the `promote` action's `release-mode` input to `combined`.

If a staged version turns out to be wrong, reject it with `npm stage reject` instead of approving it. Nothing downstream fires for a rejected version.

Expand Down
20 changes: 0 additions & 20 deletions internals/changelog/format.mjs

This file was deleted.

26 changes: 0 additions & 26 deletions internals/changelog/format.test.mjs

This file was deleted.

111 changes: 0 additions & 111 deletions scripts/createReleases.mjs

This file was deleted.

81 changes: 0 additions & 81 deletions scripts/createReleases.test.mjs

This file was deleted.

Loading
Loading