Skip to content

Commit 6b5b490

Browse files
committed
Update npm publish workflow with ghat
1 parent 4840d85 commit 6b5b490

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/npm-publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
env: {}
2+
3+
# DO NOT EDIT BELOW, USE: npx ghat fregante/ghatemplates/npm-publish
4+
5+
# Collaborators can publish a new version of what's on master via "workflow_dispatch"
6+
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
7+
8+
name: Publish
9+
10+
on:
11+
workflow_dispatch:
12+
inputs:
13+
Version:
14+
description: 'Version accepted by `npm version *`'
15+
required: true
16+
17+
jobs:
18+
NPM:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 20
24+
- uses: actions/setup-node@v1
25+
with:
26+
node-version: 14.x
27+
registry-url: 'https://registry.npmjs.org'
28+
- run: npm ci || npm install
29+
- uses: fregante/setup-git-user@v1
30+
- run: npm version ${{ github.event.inputs.Version }}
31+
- run: npm publish
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
34+
- run: git push --follow-tags
35+
- uses: notlmn/release-with-changelog@v3
36+
with:
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
exclude: true

0 commit comments

Comments
 (0)