Skip to content

Commit

Permalink
Take in version parameter when running the action manually
Browse files Browse the repository at this point in the history
  • Loading branch information
koddsson committed Oct 6, 2021
1 parent 434dc19 commit 80f59ab
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ name: Publish
on:
release:
types: [created]
workflow_dispatch:
workflow_dispatch:
inputs:
version:
description: 'Version to publish'
required: true

jobs:

Expand All @@ -20,7 +24,7 @@ jobs:
- run: npm test
- run: npm version ${TAG_NAME} --git-tag-version=false
env:
TAG_NAME: ${{ github.event.release.tag_name }}
TAG_NAME: ${{ github.event.inputs.version || github.event.release.tag_name }}
- run: npm whoami; npm --ignore-scripts publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
Expand All @@ -32,13 +36,17 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://npm.pkg.github.com/
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build --if-present
- run: npm test
- run: npm version ${TAG_NAME} --git-tag-version=false
env:
TAG_NAME: ${{ github.event.release.tag_name }}
TAG_NAME: ${{ github.event.inputs.version || github.event.release.tag_name }}
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://npm.pkg.github.com/
- run: npm whoami; npm --ignore-scripts publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit 80f59ab

Please sign in to comment.