Skip to content

Commit 23e5063

Browse files
authored
Allow bumping major versions in the release workflow (#4668)
2 parents 0e2b508 + b6c8f74 commit 23e5063

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/release-branch.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
name: Create a new release branch
22
on:
33
workflow_dispatch:
4+
inputs:
5+
kind:
6+
description: Kind of release (major = v1.2.3 -> v2.0.0-rc.0, minor = v1.2.3 -> v1.3.0-rc.0)
7+
required: true
8+
type: choice
9+
default: minor
10+
options:
11+
- major
12+
- minor
413

514
jobs:
615
compute-version:
7-
name: Compute the next minor RC version
16+
name: Compute the next ${{ inputs.kind }} RC version
817
runs-on: ubuntu-24.04
918

1019
permissions:
@@ -27,9 +36,11 @@ jobs:
2736

2837
- name: Compute the new minor RC
2938
id: next
39+
env:
40+
BUMP: pre${{ inputs.kind }}
3041
run: |
3142
CURRENT_VERSION="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "mas-cli") | .version')"
32-
NEXT_VERSION="$(npx --yes semver@7.5.4 -i preminor --preid rc "${CURRENT_VERSION}")"
43+
NEXT_VERSION="$(npx --yes semver@7.5.4 -i "$BUMP" --preid rc "${CURRENT_VERSION}")"
3344
# compute the short minor version, e.g. 0.1.0-rc.1 -> 0.1
3445
SHORT_VERSION="$(echo "${NEXT_VERSION}" | cut -d. -f1-2)"
3546
echo "full=${NEXT_VERSION}" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)