Skip to content

Commit 348622b

Browse files
authored
ci: add release-type input to release workflow (#278)
Allow choosing between patch, minor, major, and preview releases when triggering the workflow manually, instead of always publishing a preview prerelease.
1 parent 008d479 commit 348622b

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
name: Release & Publish to NPM
22

3-
on: workflow_dispatch
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release-type:
7+
description: "Release type"
8+
required: true
9+
default: "preview"
10+
type: choice
11+
options:
12+
- patch
13+
- minor
14+
- major
15+
- preview
416

517
permissions:
618
contents: write
@@ -31,7 +43,11 @@ jobs:
3143

3244
- name: Run release
3345
run: |
34-
yarn release --ci --preRelease=preview
46+
if [ "${{ inputs.release-type }}" = "preview" ]; then
47+
yarn release --ci --preRelease=preview
48+
else
49+
yarn release --ci --increment=${{ inputs.release-type }}
50+
fi
3551
env:
3652
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3753
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)