Skip to content

Commit 5acddea

Browse files
committed
ci: Bump version manually directly in CI for prerelease
1 parent 4ef2698 commit 5acddea

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
jobs:
1515
checks:
1616
uses: ./.github/workflows/checks.yml
17+
1718
publish-crates-io:
1819
name: Publish prerelease to crates.io
1920
runs-on: ubuntu-latest
@@ -33,8 +34,16 @@ jobs:
3334
- name: Compute prerelease version
3435
id: version
3536
run: |
36-
BASE_VERSION=$(cargo metadata --format-version=1 --no-deps | jq ".packages[1].version")
37-
PRERELEASE_VERSION="${BASE_VERSION}-alpha.${GITHUB_SHA::7}"
37+
# Get base version from Cargo.toml (0.0.0)
38+
BASE_VERSION=$(cargo metadata --format-version=1 --no-deps \
39+
| jq -r '.packages[] | select(.name=="libtortillas") | .version')
40+
41+
# Strip patch for next prerelease (0.0.1-alpha.<sha>)
42+
NEXT_VERSION=$(echo "$BASE_VERSION" | awk -F. \
43+
'{ printf "%d.%d.%d", $1, $2, $3+1 }')
44+
45+
PRERELEASE_VERSION="${NEXT_VERSION}-alpha.${GITHUB_SHA::7}"
46+
3847
echo "prerelease_version=$PRERELEASE_VERSION" >> $GITHUB_OUTPUT
3948
4049
- name: Set prerelease version

0 commit comments

Comments
 (0)