[pkg] ci to publish

This commit is contained in:
Revone 2023-09-26 20:21:20 +08:00
parent 8f464db4e4
commit 151593a1d2
3 changed files with 36 additions and 2 deletions

33
.github/workflows/release-package.yml vendored Normal file
View file

@ -0,0 +1,33 @@
name: data-structure-typed
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 19
- 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: 19
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

1
.npmrc Normal file
View file

@ -0,0 +1 @@
@zrwusa:registry=https://npm.pkg.github.com

View file

@ -28,7 +28,7 @@
"changelog": "auto-changelog",
"coverage:badge": "istanbul-badges-readme",
"package": "npm run lint && npm run test && npm run build && npm run build:docs && npm run changelog",
"deploy": "npm publish"
"ci": "npm run package"
},
"repository": {
"type": "git",
@ -37,7 +37,7 @@
"author": "Tyler Zeng zrwusa@gmail.com",
"license": "MIT",
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
"@zrwusa:registry": "https://npm.pkg.github.com"
},
"bugs": {
"url": "https://github.com/zrwusa/data-structure-typed/issues"