Skip to content

Commit 65e1d29

Browse files
committed
chore: add changesets release workflow
1 parent add666d commit 65e1d29

File tree

3 files changed

+50
-39
lines changed

3 files changed

+50
-39
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -168,29 +168,3 @@ jobs:
168168
status: failure
169169
env:
170170
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
171-
172-
release:
173-
name: Publish to npm
174-
runs-on: ubuntu-latest
175-
needs:
176-
- pack
177-
- verify
178-
- verify-full
179-
- unit
180-
if: startsWith(github.ref, 'refs/tags/')
181-
permissions:
182-
id-token: write
183-
contents: write
184-
steps:
185-
- uses: softprops/action-gh-release@v1
186-
with:
187-
draft: true
188-
- uses: actions/checkout@v4
189-
- uses: actions/setup-node@v4
190-
with:
191-
node-version: 22
192-
registry-url: https://registry.npmjs.org
193-
- run: corepack yarn
194-
- run: corepack yarn changeset publish
195-
env:
196-
NPM_CONFIG_PROVENANCE: "true"

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Changesets release
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
id-token: write
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
registry-url: https://registry.npmjs.org
24+
- run: corepack yarn
25+
- uses: changesets/action@v1
26+
with:
27+
version: corepack yarn changeset version
28+
publish: corepack yarn changeset publish
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
NPM_CONFIG_PROVENANCE: "true"

CONTRIBUTING.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,27 @@ yarn pack
9393

9494
## Releasing
9595

96-
Only maintainers can make releases. Releases to [npm](https://www.npmjs.com) are automated using GitHub actions and Changesets (including the legacy `transloadit` package). To make a release, perform the following steps:
96+
Only maintainers can make releases. Releases to [npm](https://www.npmjs.com) are automated using GitHub Actions and Changesets (including the legacy `transloadit` package).
9797

98-
1. Create a changeset:
98+
Release flow:
99+
100+
1. Add a changeset in your PR:
99101
- `yarn changeset`
100-
2. Version packages (updates `CHANGELOG.md` + workspace `package.json` files):
101-
- `yarn changeset version`
102-
- `git add -A && git commit -m "chore: version packages"`
103-
3. Push the version commit and tags:
104-
- `git push origin main`
105-
4. Publish (maintainers only; GitHub Actions handles the release):
106-
- `yarn changeset publish`
107-
5. When successful add [release notes](https://github.com/transloadit/node-sdk/releases).
108-
6. Scoped packages publish with the `experimental` dist-tag by default. If you need to promote a scoped package to `latest`, update the tag manually.
109-
7. If this was a pre-release, remember to reset the [npm `latest` tag](https://www.npmjs.com/package/transloadit?activeTab=versions) to the previous version (replace `x.y.z` with previous version):
110-
- `npm dist-tag add transloadit@X.Y.Z latest`
102+
2. Merge the PR to `main`.
103+
3. The `release` workflow opens a “Version Packages” PR with changelog + version bumps.
104+
4. Review and merge the version PR. CI publishes automatically via npm trusted publishing (OIDC).
105+
5. Add [release notes](https://github.com/transloadit/node-sdk/releases) once the publish succeeds.
106+
107+
Manual fallback (maintainers only):
108+
109+
- `corepack yarn changeset publish`
110+
111+
Notes:
112+
113+
- CI publishing requires npm trusted publishing (OIDC) configured for this repo.
114+
- Scoped packages publish with the `experimental` dist-tag by default. If you need to promote a scoped package to `latest`, update the tag manually.
115+
- If this was a pre-release, remember to reset the [npm `latest` tag](https://www.npmjs.com/package/transloadit?activeTab=versions) to the previous version (replace `x.y.z` with previous version):
116+
- `npm dist-tag add transloadit@X.Y.Z latest`
111117

112118
### Release FAQ
113119

0 commit comments

Comments
 (0)