Skip to content

Commit 3552578

Browse files
authored
ci: update release workflow and add jsr job (#280)
1 parent a4f5034 commit 3552578

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.github/workflows/release.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ jobs:
2525
with:
2626
node-version: 20
2727
cache: "pnpm"
28-
- run: pnpm install
28+
# Run prepublish to ensure everything is built properly
2929
# TODO: is this manual build step actually needed?
30+
- run: pnpm run ci:install
3031
# `prepack` hook _should_ run but doesn't seem to.
31-
- run: pnpm run build
32-
- uses: changesets/action@v1
32+
- run: pnpm run ci:prepublish
33+
- name: Create Release Pull Request or Publish to npm
34+
id: changesets
35+
uses: changesets/action@v1
3336
with:
3437
version: pnpm run ci:version
3538
publish: pnpm run ci:publish
@@ -38,3 +41,7 @@ jobs:
3841
env:
3942
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4043
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Publish to jsr.io
46+
if: steps.changesets.outputs.published == 'true'
47+
run: pnpx @qingshaner/jsr-release publish --changesetReleases='${{ steps.changesets.outputs.publishedPackages }}'

package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@
1111
"lint": "biome lint --write --unsafe",
1212
"type-check": "biome lint && tsc",
1313
"test": "pnpm --color -r run test",
14-
"ci:version": "changeset version && pnpm install --no-frozen-lockfile",
15-
"ci:publish": "changeset publish"
14+
"ci:install": "pnpm install --no-frozen-lockfile",
15+
"ci:version": "changeset version && pnpx @qingshaner/jsr-release --allowDirty version --sync",
16+
"ci:publish": "changeset publish",
17+
"ci:prepublish": "pnpm build",
18+
"jsr:test": "pnpm --filter \"@clack/*\" jsr --dry-run",
19+
"jsr:run": "pnpm --filter \"@clack/*\" jsr"
1620
},
1721
"devDependencies": {
1822
"@biomejs/biome": "1.9.4",

0 commit comments

Comments
 (0)