Skip to content

Commit f86f7c4

Browse files
chore: add npm release CI workflow (#10)
* chore: add npm release CI workflow * chore: remove test from prepublish
1 parent e299ca4 commit f86f7c4

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Publish Package to npmjs
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
# Setup .npmrc file to publish to npm
11+
- uses: actions/setup-node@v3
12+
with:
13+
node-version: "20.x"
14+
registry-url: "https://registry.npmjs.org"
15+
- run: npm ci
16+
- run: npm publish
17+
env:
18+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"test": "mocha -r ts-node/register --extensions ts,tsx --timeout 30000 --watch-files src,test 'test/**/*.test.ts'",
2121
"cli": "ts-node src/bin.ts",
2222
"build": "rimraf dist dist-esm && tsc && tsc -p tsconfig.esm.json",
23-
"prepublishOnly": "tsc && npm test"
23+
"prepublishOnly": "tsc"
2424
},
2525
"keywords": [
2626
"install",

0 commit comments

Comments
 (0)