Skip to content

Commit e257ca9

Browse files
authored
Support sequential release candidate tags (#95)
* Release workflow: support sequential release candidates * Release workflow: remove early-access sync script
1 parent 9e7f347 commit e257ca9

2 files changed

Lines changed: 16 additions & 138 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ on:
2020
description: "Show the tag that would be created without pushing it"
2121
type: boolean
2222
default: false
23+
release_candidate:
24+
description: "Create the next -rc.N tag"
25+
type: boolean
26+
default: false
2327

2428
permissions:
2529
contents: write
@@ -46,7 +50,7 @@ jobs:
4650
- name: Compute next version
4751
id: version
4852
run: |
49-
latest=$(git tag -l 'v*' --sort=-v:refname | head -1)
53+
latest=$(git tag -l 'v*' --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1 || true)
5054
if [ -z "$latest" ]; then
5155
latest="v0.0.0"
5256
fi
@@ -58,9 +62,18 @@ jobs:
5862
minor) minor=$((minor + 1)); patch=0 ;;
5963
patch) patch=$((patch + 1)) ;;
6064
esac
61-
next="v${major}.${minor}.${patch}"
65+
base="v${major}.${minor}.${patch}"
66+
next="$base"
67+
if [[ "${{ inputs.release_candidate }}" == "true" ]]; then
68+
latest_rc=$(git tag -l "${base}-rc.*" --sort=-v:refname | grep -E -- '-rc\.[0-9]+$' | head -1 || true)
69+
rc=1
70+
if [[ -n "$latest_rc" ]]; then
71+
rc=$((${latest_rc##*.} + 1))
72+
fi
73+
next="${base}-rc.${rc}"
74+
fi
6275
echo "tag=$next" >> "$GITHUB_OUTPUT"
63-
echo "### Next release: \`$next\` (bump: ${{ inputs.bump }}, previous: $latest)" >> "$GITHUB_STEP_SUMMARY"
76+
echo "### Next release: \`$next\` (bump: ${{ inputs.bump }}, previous stable: $latest)" >> "$GITHUB_STEP_SUMMARY"
6477
6578
- name: Create and push tag
6679
if: inputs.dry_run == false

‎script/sync-early-access-release‎

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)