fix: Do not carry over suffix when WordPress version updates
All checks were successful
Helm Chart Release / release-chart (push) Successful in 15s
Update Docker Images and Helm Chart / update (push) Successful in 19s

When WordPress version changes (e.g., 6.9.3 → 6.9.4), Chart.yaml should use
the new WordPress version WITHOUT any suffix.

Suffix (-a, -b, etc.) is only used for multiple releases within the SAME
WordPress version when non-WordPress changes occur.

Changes:
- Simplify Increment chart version step to directly use new WordPress version
- Remove complex suffix handling logic (only needed for non-WordPress updates)
- Extract WordPress version from values.yaml and apply as Chart version

Examples:
- 6.9.3-a + WordPress update → 6.9.4 (no suffix)
- 6.9.4 + Nginx update → 6.9.4-a (suffix added for non-WordPress changes)
- 6.9.4-a + Nginx update → 6.9.4-b (suffix incremented)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-10 19:31:01 +09:00
parent 7959242e1a
commit 512c80ab53

View File

@@ -224,29 +224,14 @@ jobs:
id: increment id: increment
run: | run: |
# Chart.yamlのバージョンをインクリメントWordPressバージョン更新時のみ # Chart.yamlのバージョンをインクリメントWordPressバージョン更新時のみ
# WordPressバージョン更新時は新しいWPバージョンをそのまま使用サフィックスは付けない
if [ -f Chart.yaml ]; then if [ -f Chart.yaml ]; then
CURRENT_CHART_VERSION=$(grep '^version:' Chart.yaml | awk '{print $2}') CURRENT_CHART_VERSION=$(grep '^version:' Chart.yaml | awk '{print $2}')
# values.yamlの新しいWordPressバージョンを取得appVersionではなくimageタグから
NEW_WP_VERSION=$(grep -A 3 'wordpress:' values.yaml | grep 'tag:' | awk -F'"' '{print $2}' | cut -d'-' -f1)
# バージョンのベース部分とサフィックスを分離 # Chart.yamlはWordPressバージョンに合わせて更新サフィックスなし)
if [[ $CURRENT_CHART_VERSION == *"-"* ]]; then NEW_CHART_VERSION="$NEW_WP_VERSION"
# サフィックス付き(例: 6.9.3-aの場合、サフィックスをインクリメント
BASE_VERSION="${CURRENT_CHART_VERSION%-*}"
SUFFIX="${CURRENT_CHART_VERSION#*-}"
# サフィックスをインクリメントa -> b, b -> c, など)
case "$SUFFIX" in
a) NEW_SUFFIX="b" ;;
b) NEW_SUFFIX="c" ;;
c) NEW_SUFFIX="d" ;;
d) NEW_SUFFIX="e" ;;
e) NEW_SUFFIX="f" ;;
*) NEW_SUFFIX="a" ;; # 予期しないサフィックスはリセット
esac
NEW_CHART_VERSION="${BASE_VERSION}-${NEW_SUFFIX}"
else
# サフィックスなし(例: 6.9.3)の場合、-a を追加
NEW_CHART_VERSION="${CURRENT_CHART_VERSION}-a"
fi
sed -i "s/^version: .*/version: $NEW_CHART_VERSION/" Chart.yaml sed -i "s/^version: .*/version: $NEW_CHART_VERSION/" Chart.yaml
echo "Chart version updated: $CURRENT_CHART_VERSION -> $NEW_CHART_VERSION" echo "Chart version updated: $CURRENT_CHART_VERSION -> $NEW_CHART_VERSION"