From 71d3c8446a4fbd57f2da16c038ac7fbf08263ae7 Mon Sep 17 00:00:00 2001 From: Noste <83548733+Noooste@users.noreply.github.com> Date: Fri, 15 May 2026 23:28:28 +0200 Subject: [PATCH] ci: sync Chart.yaml appVersion via post-release-please step Signed-off-by: Noste <83548733+Noooste@users.noreply.github.com> --- .github/workflows/release-please.yml | 33 +++++++++++++++++++++++++++- helm/garage-ui/Chart.yaml | 2 +- release-please-config.json | 5 +---- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index e1cd86c..2b1590b 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -19,8 +19,39 @@ jobs: app-id: ${{ secrets.RELEASE_PLEASE_APP_ID }} private-key: ${{ secrets.RELEASE_PLEASE_APP_KEY }} - - uses: googleapis/release-please-action@v4 + - id: rp + uses: googleapis/release-please-action@v4 with: config-file: release-please-config.json manifest-file: .release-please-manifest.json token: ${{ steps.app-token.outputs.token }} + + - name: Sync Chart.yaml appVersion + if: ${{ steps.rp.outputs.prs_created == 'true' }} + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + PRS: ${{ steps.rp.outputs.prs }} + REPO: ${{ github.repository }} + run: | + set -euo pipefail + echo "$PRS" | jq -c '.[]' | while read -r pr; do + branch=$(echo "$pr" | jq -r '.headBranchName') + workdir=$(mktemp -d) + git clone --branch "$branch" --depth 1 \ + "https://x-access-token:${GH_TOKEN}@github.com/${REPO}.git" "$workdir" + cd "$workdir" + git config user.email "garage-ui-release-bot[bot]@users.noreply.github.com" + git config user.name "garage-ui-release-bot[bot]" + + version=$(jq -r '."."' .release-please-manifest.json) + target="v${version}" + sed -i -E "s|^appVersion:.*|appVersion: ${target}|" helm/garage-ui/Chart.yaml + + if ! git diff --quiet helm/garage-ui/Chart.yaml; then + git add helm/garage-ui/Chart.yaml + git commit -m "chore: sync Chart.yaml appVersion to ${target}" + git push origin "$branch" + fi + cd - + rm -rf "$workdir" + done diff --git a/helm/garage-ui/Chart.yaml b/helm/garage-ui/Chart.yaml index b5f3318..d5cbfde 100644 --- a/helm/garage-ui/Chart.yaml +++ b/helm/garage-ui/Chart.yaml @@ -4,7 +4,7 @@ description: A Helm chart for Garage UI - Web interface for Garage S3 object sto icon: https://helm.noste.dev/garage.png type: application version: 0.4.1 -appVersion: v0.6.1 # x-release-please-version +appVersion: v0.6.1 keywords: - garage - s3 diff --git a/release-please-config.json b/release-please-config.json index a7d5ff5..d0fc3b0 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -9,10 +9,7 @@ "component": "garage-ui", "include-component-in-tag": false, "changelog-path": "CHANGELOG.md", - "exclude-paths": ["helm/garage-ui"], - "extra-files": [ - "helm/garage-ui/Chart.yaml" - ] + "exclude-paths": ["helm/garage-ui"] }, "helm/garage-ui": { "release-type": "helm",