Skip to content

Commit

Permalink
Automate NPM publishing in Github action publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ritsaert committed Jan 8, 2025
1 parent 31ef5ba commit 7129623
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ jobs:

- name: Run tests, coverage, create test report and badges
run: deno task test

- name: Try to build npm package
run: deno task build
16 changes: 14 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,17 @@ jobs:
with:
deno-version: v2.x

- name: Publish package
run: deno publish
- name: Publish JSR package
run: deno task publish_jsr

- name: Setup Node / NPM
uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@continuit'

- name: Publish NPM package
run: deno task publish_npm
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"test_prepare": "rm -rf test_output && mkdir -p test_output && mkdir -p test_output/deno_success && mkdir -p test_output/deno_disabled && mkdir -p test_output/deno_failed && mkdir -p test_output/jest && mkdir -p test_output/vitest && mkdir -p test_output/no_tests && mkdir -p test_output/invalid_input && mkdir -p test_output/invalid_output",
"clean": "rm -rf test_output && rm -rf coverage",
"build": "deno run -A build.ts",
"all": "deno lint && deno fmt && deno check ./src/mod.ts && deno task test && deno task build && deno fmt"
"all": "deno lint && deno fmt && deno check ./src/mod.ts && deno task test && deno task build && deno fmt",
"publish_jsr": "deno publish",
"publish_npm": "deno task build && cd npm && npm publish --public"
},
"imports": {
"@continuit/xmlscanner": "jsr:@continuit/xmlscanner@^1.0.0",
Expand Down

0 comments on commit 7129623

Please sign in to comment.