Skip to content

setup some release stuff#100

Merged
kentonv merged 8 commits intomainfrom
release-automation
Nov 4, 2025
Merged

setup some release stuff#100
kentonv merged 8 commits intomainfrom
release-automation

Conversation

@threepointone
Copy link
Collaborator

@threepointone threepointone commented Nov 3, 2025

Mostly copied from workers-oauth-provider. I still need to setup repo secrets and a couple of apps, but opening this rn.

EDIT: added secrets and apps.


This sets up some stuff for release automation, built around github actions, changesets, and pkg.pr.new.

  • pkg-pr-new.yml: For every pull request, we publish a version to their registry, and a comment will popup in the PR comments showing how to use it (eg: Add codeVerifier in TokenExchangeCallbackOptions workers-oauth-provider#99 (comment)) This lets people test out PRs before they even land.
  • prerelease.yml: whenever something lands in main, after Test(test.yml) passes, we publish to npm with @beta, with the version being the git hash. This lets people test whatever's in master quickly.
  • release.yml: When a PR lands after Test(test.yml) passes, the changeset action opens a Version Packages PR (if not already created), that deletes all changesets under the .changeset folder, and populates the CHANGELOG with their contents. You can edit the CHANGELOG further as you wish here.
  • release.yml: When the Version Packages PR itself lands, then the changesets action will do an npm release (with the highest common changeset level: path, minor, or major). It will also tag git and make a github release.

You can make a changeset in 2 ways:

  • running npx changeset in your PR branch, which will ask you a couple of questions (what level of change, and title). You can add more details directly in the generated changeset. You can add as many (or as few, even 0) changesets as you'd like.
  • Every PR will have a comment generated that shows what changesets are included (or if they're not). This will also have a link to generate and add a changeset to the PR directly (example Add codeVerifier in TokenExchangeCallbackOptions workers-oauth-provider#99 (comment))

GitHub issues this token automatically based on the permissions specified in the workflow itself. Seems like the right thing to do.
@changeset-bot
Copy link

changeset-bot bot commented Nov 4, 2025

🦋 Changeset detected

Latest commit: aec9092

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
capnweb Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 4, 2025

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/capnweb@100

commit: aec9092

Docs: https://docs.npmjs.com/trusted-publishers

This should mean no token is needed for publishing. And so, we have eliminated the need for any configured secrets!
This is needed because trusted publishing can only trust one specific workflow, so we need both actions in the same workflow. Luckily they have the same trigger...
These scripts seem to have no purpose except to run shell commands. We can just run the shell commands directly from the shell. This removes a layer of indirection, making it easier to see what's going on.
@kentonv kentonv force-pushed the release-automation branch from 04cd19d to 7cc17da Compare November 4, 2025 18:53
This lets us prevent the workflow from running on a non-main branch, even if someone edits the workflow file in their PR.
(For the release workflow, moved the permissions to the right place to affect both jobs.)
@kentonv kentonv merged commit 032de6b into main Nov 4, 2025
6 checks passed
@kentonv kentonv deleted the release-automation branch November 4, 2025 19:34
@github-actions github-actions bot mentioned this pull request Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants