44 tags :
55 - " v*"
66
7+ concurrency :
8+ group : publish-${{ github.ref }}
9+ cancel-in-progress : false
10+
711jobs :
12+ preflight :
13+ runs-on : ubuntu-latest
14+
15+ permissions :
16+ contents : read
17+
18+ steps :
19+ - uses : actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
20+
21+ - name : Setup Deno
22+ uses : denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2
23+ with :
24+ deno-version : v2.6.8
25+
26+ - name : Setup Node
27+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
28+ with :
29+ node-version : 24
30+
31+ - name : Verify tag matches deno.json version
32+ shell : bash
33+ run : |
34+ set -euo pipefail
35+ tag="${GITHUB_REF_NAME}"
36+ if [[ ! "${tag}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
37+ echo "Tag '${tag}' is not a stable semantic version."
38+ exit 1
39+ fi
40+ deno_version="$(deno eval 'console.log(JSON.parse(Deno.readTextFileSync("deno.json")).version)')"
41+ if [[ "${tag}" != "v${deno_version}" ]]; then
42+ echo "Tag '${tag}' does not match deno.json version '${deno_version}'."
43+ exit 1
44+ fi
45+
46+ - name : Run checks
47+ run : deno task check
48+
49+ - name : Verify JSR package
50+ run : deno publish --dry-run
51+
52+ - name : Build npm package
53+ run : deno task build:npm
54+
55+ - name : Smoke test npm entry points
56+ run : >-
57+ node --input-type=module -e
58+ 'await Promise.all([
59+ import("./npm/esm/mod.js"),
60+ import("./npm/esm/src/nondeterministic.js"),
61+ import("./npm/esm/src/perf.js")
62+ ])'
63+
64+ - name : Verify npm package contents
65+ run : npm pack ./npm --dry-run
66+
867 publish-jsr :
968 runs-on : ubuntu-latest
69+ needs : preflight
1070
1171 permissions :
1272 contents : read
1373 id-token : write
1474
1575 steps :
16- - uses : actions/checkout@v4
76+ - uses : actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
77+
78+ - name : Setup Deno
79+ uses : denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2
80+ with :
81+ deno-version : v2.6.8
1782
1883 - name : Publish to JSR
19- run : npx jsr publish
84+ run : deno publish
2085
2186 publish-npm :
2287 runs-on : ubuntu-latest
2388 needs : publish-jsr
2489
2590 permissions :
2691 contents : read
92+ id-token : write
2793
2894 steps :
29- - uses : actions/checkout@v4
95+ - uses : actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
3096
3197 - name : Setup Deno
32- uses : denoland/setup-deno@v2
98+ uses : denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2
3399 with :
34- deno-version : v2.x
100+ deno-version : v2.6.8
35101
36102 - name : Setup Node
37- uses : actions/setup-node@v4
103+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
38104 with :
39- node-version : 20
105+ node-version : 24
40106 registry-url : " https://registry.npmjs.org"
41107
42108 - name : Build npm package
43109 run : deno task build:npm
44110
45111 - name : Publish to npm
46- run : npm publish ./npm --access public
112+ run : npm publish ./npm --access public --provenance
47113 env :
48114 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
49115
@@ -55,22 +121,10 @@ jobs:
55121 contents : write
56122
57123 steps :
58- - uses : actions/checkout@v4
124+ - uses : actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
59125 with :
60126 fetch-depth : 0
61127
62- - name : Verify tag matches deno.json version
63- shell : bash
64- run : |
65- set -euo pipefail
66- tag="${GITHUB_REF_NAME}"
67- version="${tag#v}"
68- deno_version="$(node -p "require('./deno.json').version")"
69- if [[ "${deno_version}" != "${version}" ]]; then
70- echo "Tag '${tag}' does not match deno.json version '${deno_version}'."
71- exit 1
72- fi
73-
74128 - name : Generate changelog
75129 shell : bash
76130 run : |
99153 } > RELEASE_NOTES.md
100154
101155 - name : Create GitHub release
102- uses : softprops/action-gh-release@v2
156+ uses : softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
103157 with :
104158 name : ${{ github.ref_name }}
105159 tag_name : ${{ github.ref_name }}
0 commit comments