Skip to content

ci: update release workflow and add jsr job #280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ jobs:
with:
node-version: 20
cache: "pnpm"
- run: pnpm install
# Run prepublish to ensure everything is built properly
# TODO: is this manual build step actually needed?
- run: pnpm run ci:install
# `prepack` hook _should_ run but doesn't seem to.
- run: pnpm run build
- uses: changesets/action@v1
- run: pnpm run ci:prepublish
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm run ci:version
publish: pnpm run ci:publish
Expand All @@ -38,3 +41,7 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to jsr.io
if: steps.changesets.outputs.published == 'true'
run: pnpx @qingshaner/jsr-release publish --changesetReleases='${{ steps.changesets.outputs.publishedPackages }}'
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
"lint": "biome lint --write --unsafe",
"type-check": "biome lint && tsc",
"test": "pnpm --color -r run test",
"ci:version": "changeset version && pnpm install --no-frozen-lockfile",
"ci:publish": "changeset publish"
"ci:install": "pnpm install --no-frozen-lockfile",
"ci:version": "changeset version && pnpx @qingshaner/jsr-release --allowDirty version --sync",
"ci:publish": "changeset publish",
"ci:prepublish": "pnpm build",
"jsr:test": "pnpm --filter \"@clack/*\" jsr --dry-run",
"jsr:run": "pnpm --filter \"@clack/*\" jsr"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
Expand Down