Skip to content

Commit ca250fb

Browse files
authored
Add npm release workflow (#336)
* Add release workflow * Move building to prepack and and add linting and testing to prepublish * Fix package-lock.json
1 parent 160b604 commit ca250fb

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch: ~
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: 'lts/*'
16+
cache: 'npm'
17+
- run: npm ci
18+
- run: npm publish
19+
env:
20+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package-lock.json

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"bump": "gulp bump",
2626
"test": "nyc mocha",
2727
"watch": "nodemon --exec \"mocha\"",
28-
"prepublishOnly": "npm run build && npm run build-dist",
28+
"prepack": "npm run build && npm run build-dist",
29+
"prepublishOnly": "npm run test && npm run lint",
2930
"cover-report": "open coverage/lcov-report/index.html",
3031
"cover-publish": "nyc mocha && codeclimate < coverage/lcov.info"
3132
},

0 commit comments

Comments
 (0)