From c5ff5189f64ef9d60c3f5c649e07e8b29f4e86df Mon Sep 17 00:00:00 2001 From: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> Date: Mon, 7 Apr 2025 18:23:12 -0600 Subject: [PATCH] ci: update release workflow and add jsr job --- .github/workflows/release.yml | 13 ++++++++++--- package.json | 8 ++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5fedf940..544a3e01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 }}' diff --git a/package.json b/package.json index 7481e2e5..5cd73a9f 100644 --- a/package.json +++ b/package.json @@ -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",