From 77ca5375528c3103e9a9f9fdb10515072db423ce Mon Sep 17 00:00:00 2001 From: Madison Grubb Date: Thu, 12 Mar 2026 15:26:56 -0400 Subject: [PATCH] patch: fix release file --- scripts/release.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/scripts/release.sh b/scripts/release.sh index 51846b5..b5c682d 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -19,15 +19,11 @@ echo "$msg" | grep -Eqi '(^|[[:space:]])[a-zA-Z]+(\([^)]*\))?!:' && bump=major # Explicit bump prefixes still supported (but never downgrade a major bump) echo "$msg" | grep -qi minor: && [ "$bump" != "major" ] && bump=minor echo "$msg" | grep -qi major: && bump=major -cur=$(cat VERSION | tr -d '\n') -case "$cur" in - [0-9]*.[0-9]*.[0-9]*) ;; - *) echo "error: VERSION must be x.y.z (got: $cur)"; exit 1 ;; -esac +cur=$(awk '/"version"/ { match($0, /[0-9]+\.[0-9]+\.[0-9]+/); print substr($0, RSTART, RLENGTH); exit }' package.json) major=$(echo "$cur" | cut -d. -f1); minor=$(echo "$cur" | cut -d. -f2); patch=$(echo "$cur" | cut -d. -f3) case "$bump" in major) major=$((major+1)); minor=0; patch=0 ;; minor) minor=$((minor+1)); patch=0 ;; patch) patch=$((patch+1)) ;; esac newVersion="$major.$minor.$patch" -[ -z "$cur" ] && { echo "error: could not read version from VERSION"; exit 1; } +[ -z "$cur" ] && { echo "error: could not read version from package.json"; exit 1; } # changelog entry (strip explicit bump prefixes & any conventional-commit type(scope):); optional PR description enriches it changelogEntry=$( @@ -46,9 +42,9 @@ else fi # bump files -echo "$newVersion" > VERSION -awk -v v="$newVersion" '/^version:/ { $0 = "version: " v }; /^appVersion:/ { $0 = "appVersion: \"" v "\"" }; { print }' helm/jasper/Chart.yaml > helm/jasper/Chart.yaml.tmp && mv helm/jasper/Chart.yaml.tmp helm/jasper/Chart.yaml -awk -v v="$newVersion" '/^ tag:/ { $0 = " tag: " v }; { print }' helm/jasper/values.yaml > helm/jasper/values.yaml.tmp && mv helm/jasper/values.yaml.tmp helm/jasper/values.yaml +awk -v v="$newVersion" '/"version"/ { sub(/[0-9]+\.[0-9]+\.[0-9]+/, v) } { print }' package.json > package.json.tmp && mv package.json.tmp package.json +awk -v v="$newVersion" '/^version:/ { $0 = "version: " v }; /^appVersion:/ { $0 = "appVersion: \"" v "\"" }; { print }' helm/kestrelos/Chart.yaml > helm/kestrelos/Chart.yaml.tmp && mv helm/kestrelos/Chart.yaml.tmp helm/kestrelos/Chart.yaml +awk -v v="$newVersion" '/^ tag:/ { $0 = " tag: " v }; { print }' helm/kestrelos/values.yaml > helm/kestrelos/values.yaml.tmp && mv helm/kestrelos/values.yaml.tmp helm/kestrelos/values.yaml # changelog new="## [$newVersion] - $(date +%Y-%m-%d) @@ -61,7 +57,7 @@ $changelogFull # git git config user.email "ci@kestrelos" && git config user.name "CI" -git add VERSION helm/jasper/Chart.yaml helm/jasper/values.yaml CHANGELOG.md +git add package.json helm/kestrelos/Chart.yaml helm/kestrelos/values.yaml CHANGELOG.md git commit -m "release v$newVersion [skip ci]" url="https://${CI_REPO_OWNER}:${GITEA_REPO_TOKEN}@${CI_FORGE_URL#https://}/${CI_REPO_OWNER}/${CI_REPO_NAME}.git" git tag "v$newVersion" -- 2.52.0