Skip to content

Commit 10ece45

Browse files
Kamalpreet Kaurclaude
andcommitted
Add a prerelease option for test releases
prerelease publishes <next>-tp.0 to the next dist-tag and pushes only its tag, so the setup can be checked without moving latest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 54258b9 commit 10ece45

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ on:
44
workflow_dispatch:
55
inputs:
66
bump:
7-
description: Version bump
7+
description: Version bump (prerelease publishes <next>-tp.0 to the next dist-tag for testing)
88
required: true
99
default: patch
1010
type: choice
1111
options:
1212
- patch
1313
- minor
1414
- major
15+
- prerelease
1516

1617
permissions:
1718
contents: read
@@ -41,12 +42,17 @@ jobs:
4142
run: |
4243
git config user.name "github-actions[bot]"
4344
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
44-
npm version "$BUMP"
45+
npm version "$BUMP" --preid tp
4546
4647
- name: Publish
47-
run: npm publish --access public
48+
run: npm publish --access public --tag "$([ "$BUMP" = prerelease ] && echo next || echo latest)"
49+
50+
- name: Push tag
51+
if: inputs.bump == 'prerelease'
52+
run: git push origin "$(git describe --exact-match)"
4853

4954
- name: Push tag and version bump branch
55+
if: inputs.bump != 'prerelease'
5056
run: |
5157
branch="release-$(date +%s)"
5258
git push --follow-tags origin "HEAD:refs/heads/$branch"

0 commit comments

Comments
 (0)