Skip to content

Commit 032912b

Browse files
committed
ready for jsr?
1 parent 0f2e6e5 commit 032912b

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

.github/workflows/publish-jsr.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Publish (JSR)
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published]
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
publish:
12+
permissions:
13+
contents: read
14+
id-token: write
15+
name: Publish to JSR
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Publish
20+
run: npx jsr publish --provenance --allow-slow-types

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ jobs:
3737
createGithubReleases: true
3838
env:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Update version for deno/jsr
42+
if: steps.changesets.outputs.hasChangesets == 'false'
43+
run: node sync_versions.mjs

sync_versions.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { readFileSync, writeFileSync } from "node:fs";
2+
3+
const pkgBuff = readFileSync("./package.json");
4+
const pkg = JSON.parse(pkgBuff);
5+
6+
const jsrBuff = readFileSync("./deno.jsonc");
7+
const jsrCurr = JSON.parse(jsrBuff);
8+
9+
if (jsrCurr.version !== pkg.version) {
10+
console.log("Updating deno version");
11+
jsrCurr.version = pkg.version;
12+
13+
writeFileSync("./deno.jsonc", JSON.stringify(jsrCurr));
14+
} else {
15+
console.log("deno version already up to date");
16+
}

0 commit comments

Comments
 (0)