Skip to content

Commit 93cf4f2

Browse files
committed
chore: migrate to changesets for publishing
1 parent 363e89e commit 93cf4f2

4 files changed

Lines changed: 525 additions & 17 deletions

File tree

.changeset/config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@1.0.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"access": "public",
6+
"baseBranch": "main"
7+
}

.github/workflows/release.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ jobs:
88
publish:
99
runs-on: ubuntu-latest
1010
permissions:
11-
contents: read
11+
contents: write
1212
id-token: write
1313

1414
steps:
1515
- name: Checkout code
1616
uses: actions/checkout@v6
1717
with:
18+
fetch-depth: 0
1819
persist-credentials: false
1920

2021
- name: Setup Node.js
@@ -29,21 +30,16 @@ jobs:
2930
- name: Run tests
3031
run: yarn test
3132

32-
- name: Build package
33-
run: yarn build
34-
3533
- name: Get Artifact Publish Token
3634
id: publish-token
3735
uses: atlassian-labs/artifact-publish-token@v1.0.1
3836
with:
3937
output-modes: npm
4038

41-
- name: Publish to Artifactory npm-public
42-
run: |
43-
ARTIFACTORY_PASSWORD=$(echo "${ARTIFACTORY_PASSWORD_BASE64}" | base64 -d)
44-
AUTH_TOKEN=$(echo -n "${ARTIFACTORY_USERNAME}:${ARTIFACTORY_PASSWORD}" | base64 -w 0)
45-
echo "//packages.atlassian.com/api/npm/npm-public/:_auth=${AUTH_TOKEN}" > .npmrc-resolved
46-
echo "//packages.atlassian.com/api/npm/npm-public/:email=build-team@atlassian.com" >> .npmrc-resolved
47-
npm publish
39+
- name: Create Release Pull Request or Publish to npm
40+
uses: changesets/action@v1
41+
with:
42+
publish: yarn release
4843
env:
49-
NPM_CONFIG_USERCONFIG: ${{ github.workspace }}/.npmrc-resolved
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
NPM_CONFIG_USERCONFIG: ${{ github.workspace }}/.npmrc-public

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"!dist/__test__/**"
4747
],
4848
"scripts": {
49+
"release": "yarn build && changeset publish",
4950
"test": "jest --config jest.config.json",
5051
"build": "tsc --project tsconfig.json",
5152
"lint": "eslint ./src --config eslint.config.mts --ext .ts"
@@ -55,6 +56,7 @@
5556
"node": ">=20.0.0"
5657
},
5758
"devDependencies": {
59+
"@changesets/cli": "^2.30.0",
5860
"@types/jest": "^30.0.0",
5961
"eslint": "^9.32.0",
6062
"eslint-config-prettier": "^10.1.8",

0 commit comments

Comments
 (0)