Skip to content

Commit

Permalink
chore: changesets scripts use exec
Browse files Browse the repository at this point in the history
  • Loading branch information
GauBen committed Nov 8, 2024
1 parent 475a967 commit 555f423
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ jobs:
uses: changesets/action@v1
with:
title: "chore: release packages"
publish: yarn build && yarn changeset publish && yarn jsr publish
version: |
yarn changeset version && \
yarn node -e 'fs.writeFileSync("jsr.json", fs.readFileSync("jsr.json", "utf-8").replace(/"version": ".+"/, `"version": "${process.env.npm_package_version}"`))' && \
git add jsr.json
publish: yarn publish
version: yarn version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
9 changes: 9 additions & 0 deletions jsr-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import fs from "node:fs";

// Update jsr.json#version with the current package version
fs.writeFileSync(
"jsr.json",
fs
.readFileSync("jsr.json", "utf-8")
.replace(/"version": ".+"/, `"version": "${process.env.npm_package_version}"`),
);
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"check": "yarn workspaces foreach -W run check",
"dev": "pkgroll --sourcemap --watch",
"lint": "biome check --fix",
"publish": "yarn build && yarn changeset publish && yarn jsr publish",
"version": "yarn changeset version && yarn node jsr-version.js && git add jsr.json",
"test": "tsc --noEmit && tsx --experimental-test-coverage --experimental-test-isolation=none --test-coverage-exclude='src/**/*.test.ts' --test-coverage-branches=100 --test 'src/**/*.test.ts'"
},
"devDependencies": {
Expand Down

0 comments on commit 555f423

Please sign in to comment.