Skip to content

Commit f54448c

Browse files
committed
chore: migrate to changeset-based release flow on push to main
1 parent f0133f4 commit f54448c

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
name: Release
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
branches:
6+
- main
67

78
jobs:
89
publish:
910
runs-on: ubuntu-latest
1011
permissions:
11-
contents: read
12+
contents: write
1213
id-token: write
14+
pull-requests: write
1315

1416
steps:
1517
- name: Checkout code
1618
uses: actions/checkout@v6
1719
with:
20+
fetch-depth: 0
1821
persist-credentials: false
1922

2023
- name: Setup Node.js
@@ -29,16 +32,16 @@ jobs:
2932
- name: Run tests
3033
run: yarn test
3134

32-
- name: Build package
33-
run: yarn build
34-
3535
- name: Get Artifact Publish Token
3636
id: publish-token
3737
uses: atlassian-labs/artifact-publish-token@v1.0.1
3838
with:
3939
output-modes: npm
4040

41-
- name: Publish to Artifactory npm-public
42-
run: yarn release
41+
- name: Create Release Pull Request or Publish to Artifactory
42+
uses: changesets/action@v1
43+
with:
44+
publish: yarn release
4345
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4447
NPM_CONFIG_USERCONFIG: ${{ github.workspace }}/.npmrc-public

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,14 @@ The library includes comprehensive tests covering:
182182

183183
## Releasing
184184

185-
Releases are published to [Artifactory npm-public](https://packages.atlassian.com/api/npm/npm-public/) and forwarded to npmjs.org.
185+
Releases are published to [Artifactory npm-public](https://packages.atlassian.com/api/npm/npm-public/) and forwarded to npmjs.org using [Changesets](https://github.com/changesets/changesets).
186186

187-
To publish a new release:
187+
### How to release
188188

189-
1. Create a [GitHub Release](https://github.com/atlassian-labs/lexicographic-keys/releases/new) with a tag matching the new version (e.g. `1.2.0`).
190-
2. The [Release workflow](.github/workflows/release.yml) will automatically trigger, run tests, and publish the package using `changeset publish` via Artifactory.
189+
1. In your PR branch, run `yarn changeset` and follow the prompts to describe your changes and select a version bump type (patch/minor/major). This creates a changeset file — commit it with your PR.
190+
2. Merge your PR to `main`.
191+
3. The [Release workflow](.github/workflows/release.yml) will automatically open a **"Version Packages" PR** that bumps the version and updates the CHANGELOG.
192+
4. Review and merge the "Version Packages" PR — the workflow will then publish the new version to Artifactory automatically.
191193

192194
> **Note:** Publishing uses [`atlassian-labs/artifact-publish-token`](https://github.com/atlassian-labs/artifact-publish-token) for authentication — no manual npm credentials are required.
193195

0 commit comments

Comments
 (0)