Skip to content

Commit

Permalink
workflow to publish package
Browse files Browse the repository at this point in the history
  • Loading branch information
manh-t committed Dec 27, 2023
1 parent adea328 commit cdb036d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm test

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"bugs": {
"url": "https://github.com/manh-t/package-publishing-github/issues"
},
"homepage": "https://github.com/manh-t/package-publishing-github#readme"
"homepage": "https://github.com/manh-t/package-publishing-github#readme",
"publishConfig": {
"@manh-t:registry": "https://npm.pkg.github.com"
}
}

0 comments on commit cdb036d

Please sign in to comment.