Skip to content

Commit cc5cdd6

Browse files
committed
Allow automated publishing
Closes #36
1 parent 3deedf1 commit cc5cdd6

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/npm-publish.yml

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

0 commit comments

Comments
 (0)