Skip to content

Commit

Permalink
fix build script
Browse files Browse the repository at this point in the history
  • Loading branch information
YieldRay committed Mar 28, 2024
1 parent cba7281 commit d00dd05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ jobs:
run: deno publish --allow-dirty

- name: Build for NPM
run: deno run -A build.ts
run: deno task build

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"

- name: NPM (dry run)
if: github.event_name == 'push'
Expand All @@ -46,3 +52,5 @@ jobs:
- name: NPM (real)
if: github.event_name == 'release'
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
3 changes: 2 additions & 1 deletion build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ console.log(

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

if (Deno.statSync('./package.json').isFile) {
try {
Deno.removeSync('./package.json')
} catch { // NOOP
}

const packageJson = {
Expand Down

0 comments on commit d00dd05

Please sign in to comment.