Skip to content

Commit bddf80b

Browse files
Support dispatch workflows for make-release-artifacts and publish-release
1 parent 26e555d commit bddf80b

2 files changed

Lines changed: 28 additions & 8 deletions

File tree

.github/workflows/make-release-artifacts.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,27 @@ on:
66
- reopened
77
- opened
88
- synchronize
9+
workflow_dispatch:
10+
inputs:
11+
tag:
12+
type: string
13+
description: 'The release tag that should be referenced (i.e. `v1.2.3`)'
14+
required: true
15+
force:
16+
type: boolean
17+
description: 'Force the release artifacts to be created and uploaded'
18+
required: false
19+
default: false
920

1021
jobs:
1122
run:
12-
if: startsWith( github.head_ref, 'release/')
23+
if: github.event_name == 'workflow_dispatch' || startsWith( github.head_ref, 'release/')
1324
uses: rokucommunity/workflows/.github/workflows/make-release-artifacts.yml@master
1425
with:
15-
branch: ${{ github.event.pull_request.head.ref }}
26+
branch: ${{ github.event.inputs.tag || github.event.pull_request.head.ref }}
1627
node-version: "16.20.2"
1728
artifact-paths: "./*.tgz" # "*.vsix"
29+
force: ${{ github.event.inputs.force == 'true' }}
1830
secrets: inherit
1931

2032
success-or-skip:
@@ -23,3 +35,4 @@ jobs:
2335
runs-on: ubuntu-latest
2436
steps:
2537
- run: if [ "${{ needs.run.result }}" = "failure" ]; then exit 1; fi
38+

.github/workflows/publish-release.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,23 @@ name: Publish Release
33
on:
44
pull_request:
55
types:
6-
- closed
6+
- closed
77
paths:
8-
- 'package.json'
9-
- 'package-lock.json'
8+
- "package.json"
9+
- "package-lock.json"
10+
workflow_dispatch:
11+
inputs:
12+
tag:
13+
type: string
14+
description: "The release tag that should be published (i.e. `v1.2.3`)"
15+
required: true
1016

1117
jobs:
1218
run:
13-
if: startsWith( github.head_ref, 'release/') && (github.event.pull_request.merged == true)
19+
if: github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release/')
1420
uses: rokucommunity/workflows/.github/workflows/publish-release.yml@master
1521
with:
16-
release-type: "npm" # "vsce"
17-
ref: ${{ github.event.pull_request.merge_commit_sha }}
22+
release-type: "npm" # or "vsce"
23+
ref: ${{ github.event.inputs.tag || github.event.pull_request.merge_commit_sha }}
1824
secrets: inherit
25+

0 commit comments

Comments
 (0)