Skip to content

Commit

Permalink
Allow automated publishing
Browse files Browse the repository at this point in the history
Closes #36
  • Loading branch information
fregante committed Sep 12, 2022
1 parent 3deedf1 commit cc5cdd6
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
env: {}

# FILE GENERATED WITH: npx ghat fregante/ghatemplates/npm-publish
# SOURCE: https://github.com/fregante/ghatemplates

# Collaborators can publish a new version of what's on master via "workflow_dispatch"
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/

name: Publish

on:
workflow_dispatch:
inputs:
Version:
description: 'Version accepted by `npm version *`'
required: true

jobs:
NPM:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 20
- uses: actions/setup-node@v3
with:
node-version: 14.x
registry-url: 'https://registry.npmjs.org'
- run: npm ci || npm install
- uses: fregante/setup-git-user@v1
- run: npm version ${{ github.event.inputs.Version }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: git push --follow-tags
- uses: fregante/release-with-changelog@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
exclude: true

0 comments on commit cc5cdd6

Please sign in to comment.