From fd1b33804c1d25e9926a4694ba7bfacd8ec54c2e Mon Sep 17 00:00:00 2001 From: thepagent Date: Sat, 11 Apr 2026 16:35:43 +0800 Subject: [PATCH] fix: keep Cargo.toml at stable version, read version from Chart.yaml - Cargo.toml stays at stable version on main (e.g. 0.6.4) - Chart.yaml gets the full version (beta or stable) - Version source changed from Cargo.toml to Chart.yaml - Removed rust-toolchain/cargo generate-lockfile (not needed) --- .github/workflows/release-pr.yml | 12 ++++++++---- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index b6c3658..b87d63f 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -42,7 +42,7 @@ jobs: if [ -n "${{ inputs.version }}" ]; then VERSION="${{ inputs.version }}" else - CURRENT=$(grep '^version = ' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/') + CURRENT=$(grep '^version:' charts/openab/Chart.yaml | awk '{print $2}') BASE="${CURRENT%%-*}" IFS='.' read -r major minor patch <<< "$BASE" case "${{ inputs.bump }}" in @@ -55,15 +55,19 @@ jobs: echo "version=${VERSION}" >> "$GITHUB_OUTPUT" echo "::notice::Release version: ${VERSION}" - - uses: dtolnay/rust-toolchain@stable + # Determine stable version (strip pre-release suffix) + STABLE="${VERSION%%-*}" + echo "stable=${STABLE}" >> "$GITHUB_OUTPUT" - name: Update version files run: | VERSION="${{ steps.version.outputs.version }}" - sed -i "s/^version = .*/version = \"${VERSION}\"/" Cargo.toml + STABLE="${{ steps.version.outputs.stable }}" + # Chart.yaml always gets the full version (beta or stable) sed -i "s/^version: .*/version: ${VERSION}/" charts/openab/Chart.yaml sed -i "s/^appVersion: .*/appVersion: \"${VERSION}\"/" charts/openab/Chart.yaml - cargo generate-lockfile + # Cargo.toml only gets stable version (main stays clean) + sed -i "s/^version = .*/version = \"${STABLE}\"/" Cargo.toml - name: Create release PR env: diff --git a/Cargo.lock b/Cargo.lock index 11d2516..d123d5e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -763,7 +763,7 @@ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "openab" -version = "0.6.4-beta.1" +version = "0.6.4" dependencies = [ "anyhow", "base64", diff --git a/Cargo.toml b/Cargo.toml index c3f285d..2b56c02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openab" -version = "0.6.4-beta.1" +version = "0.6.4" edition = "2021" [dependencies]