Skip to content

Commit 80f59ab

Browse files
authored
Take in version parameter when running the action manually
1 parent 434dc19 commit 80f59ab

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/publish.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ name: Publish
33
on:
44
release:
55
types: [created]
6-
workflow_dispatch:
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Version to publish'
10+
required: true
711

812
jobs:
913

@@ -20,7 +24,7 @@ jobs:
2024
- run: npm test
2125
- run: npm version ${TAG_NAME} --git-tag-version=false
2226
env:
23-
TAG_NAME: ${{ github.event.release.tag_name }}
27+
TAG_NAME: ${{ github.event.inputs.version || github.event.release.tag_name }}
2428
- run: npm whoami; npm --ignore-scripts publish
2529
env:
2630
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
@@ -32,13 +36,17 @@ jobs:
3236
- uses: actions/setup-node@v2
3337
with:
3438
node-version: 14
35-
registry-url: https://npm.pkg.github.com/
39+
registry-url: https://registry.npmjs.org/
3640
- run: npm ci
3741
- run: npm run build --if-present
3842
- run: npm test
3943
- run: npm version ${TAG_NAME} --git-tag-version=false
4044
env:
41-
TAG_NAME: ${{ github.event.release.tag_name }}
45+
TAG_NAME: ${{ github.event.inputs.version || github.event.release.tag_name }}
46+
- uses: actions/setup-node@v2
47+
with:
48+
node-version: 14
49+
registry-url: https://npm.pkg.github.com/
4250
- run: npm whoami; npm --ignore-scripts publish
4351
env:
4452
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)