Skip to content

Commit aa09746

Browse files
chore: Support alpha and beta release (#97)
1 parent d875790 commit aa09746

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

.github/workflows/publish.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
name: Publish to npm
1+
name: publish
2+
run-name: Publishing ${{ github.event.inputs.release_type || 'stable' }} release
23

34
on:
45
workflow_dispatch:
6+
inputs:
7+
release-type:
8+
description: 'Release type'
9+
required: true
10+
default: 'stable'
11+
type: choice
12+
options:
13+
- stable
14+
- alpha
15+
- beta
516

617
permissions:
718
id-token: write
@@ -46,7 +57,11 @@ jobs:
4657
- name: Semantic Release
4758
run: |
4859
npm whoami
49-
npx semantic-release
60+
if [ "${{ github.event.inputs.release-type }}" != "stable" ]; then
61+
npx semantic-release --tag ${{ github.event.inputs.release-type }}
62+
else
63+
npx semantic-release
64+
fi
5065
env:
5166
GITHUB_TOKEN: ${{ secrets.PRIVATE_GITHUB_TOKEN }}
5267
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.releaserc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
22
"branches": [
3-
"main"
3+
"main",
4+
{
5+
"name": "beta",
6+
"prerelease": true
7+
},
8+
{
9+
"name": "alpha",
10+
"prerelease": true
11+
}
412
]
513
}

0 commit comments

Comments
 (0)