Skip to content

Commit d00dd05

Browse files
committed
fix build script
1 parent cba7281 commit d00dd05

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/publish.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ jobs:
3737
run: deno publish --allow-dirty
3838

3939
- name: Build for NPM
40-
run: deno run -A build.ts
40+
run: deno task build
41+
42+
- name: Set up Node
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: "20.x"
46+
registry-url: "https://registry.npmjs.org"
4147

4248
- name: NPM (dry run)
4349
if: github.event_name == 'push'
@@ -46,3 +52,5 @@ jobs:
4652
- name: NPM (real)
4753
if: github.event_name == 'release'
4854
run: npm publish --provenance --access public
55+
env:
56+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

build.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ console.log(
1111

1212
const pkg = JSON.parse(Deno.readTextFileSync('./deno.json'))
1313

14-
if (Deno.statSync('./package.json').isFile) {
14+
try {
1515
Deno.removeSync('./package.json')
16+
} catch { // NOOP
1617
}
1718

1819
const packageJson = {

0 commit comments

Comments
 (0)