Skip to content

Commit 1abeb1b

Browse files
committed
chore: configure release-please for next branch with RC support
1 parent 91680c8 commit 1abeb1b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/release-please.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- next
78
workflow_dispatch:
89

910
env:
@@ -42,20 +43,24 @@ jobs:
4243
id: release
4344
with:
4445
token: ${{ secrets.GITHUB_TOKEN }}
45-
target-branch: main
46+
target-branch: ${{ github.ref_name }}
4647
config-file: .release-please-config.json
4748
manifest-file: .release-please-manifest.json
4849

49-
# 7️⃣ Determine npm tag based on version
50+
# 7️⃣ Determine npm tag based on version and branch
5051
- name: Determine npm tag
5152
id: npm_tag
5253
if: steps.release.outputs.releases_created == 'true'
5354
run: |
5455
# Get the first package version from release outputs
5556
VERSION=$(echo '$RELEASE_OUTPUTS' | jq -r '.[] | select(type == "string" and test("^[0-9]")) | select(. != null)' | head -n1)
5657
57-
# If version contains prerelease identifier (rc, alpha, beta, etc.), use 'next' tag
58-
if [[ "$VERSION" =~ -rc\.|-.+\. ]] || [[ "$VERSION" =~ -rc$|-(alpha|beta|next|canary) ]]; then
58+
# On 'next' branch, always use 'next' tag
59+
if [[ "${{ github.ref_name }}" == "next" ]]; then
60+
echo "tag=next" >> $GITHUB_OUTPUT
61+
echo "Publishing from next branch with tag: next"
62+
# On 'main' branch, check if version is prerelease
63+
elif [[ "$VERSION" =~ -rc\.|-.+\. ]] || [[ "$VERSION" =~ -rc$|-(alpha|beta|next|canary) ]]; then
5964
echo "tag=next" >> $GITHUB_OUTPUT
6065
echo "Publishing as prerelease with tag: next"
6166
else

0 commit comments

Comments
 (0)