From ca137103afe5084a003d4facb7210c7864b50068 Mon Sep 17 00:00:00 2001 From: Hendrik Brombeer Date: Sun, 26 Apr 2026 14:01:16 +0200 Subject: [PATCH] ci: release-please + helm push to GHCR OCI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit release-please-config.json: type=helm, bump-minor-pre-major, no component-in-tag. release.yml: on push to main, release-please runs; if release_created, the helm-push job packages the chart and pushes to oci://ghcr.io/groundsgg/charts. Tag/version mismatch is a hard fail (release-please should keep them in sync via the helm release-type's Chart.yaml version updater). No v0.1.0 release is cut here — that waits on plugin-agones #36 merge + velocity image bump (T10). Until then, only the dev/edge tag flow exercises the pipeline if a feat/* commit lands on main. --- .github/workflows/release.yml | 55 +++++++++++++++++++++++++++++++++++ .release-please-manifest.json | 1 + release-please-config.json | 11 +++++++ 3 files changed, 67 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c9da8a3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +name: release + +on: + push: + branches: [main] + +permissions: + contents: write + packages: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + steps: + - uses: googleapis/release-please-action@v5 + id: release + with: + config-file: release-please-config.json + manifest-file: .release-please-manifest.json + + helm-push: + needs: release-please + if: ${{ needs.release-please.outputs.release_created }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + ref: ${{ needs.release-please.outputs.tag_name }} + + - name: Set up Helm + uses: azure/setup-helm@v4 + with: + version: v3.18.4 + + - name: Login to GHCR + run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin + + - name: Helm package + push to GHCR OCI + run: | + set -euo pipefail + tag="${{ needs.release-please.outputs.tag_name }}" + version="${tag#v}" + # release-please updated Chart.yaml's `version` to match the tag; + # double-check before packaging so we do not push a mismatched chart. + chart_version=$(grep -E '^version: ' Chart.yaml | awk '{print $2}') + if [ "$chart_version" != "$version" ]; then + echo "::error::Chart.yaml version ($chart_version) does not match tag ($version)" + exit 1 + fi + helm package . + helm push "platform-vcluster-template-${version}.tgz" oci://ghcr.io/groundsgg/charts diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..b719d43 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1 @@ +{".":"0.0.0"} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..513b4a4 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,11 @@ +{ + "release-type": "helm", + "include-component-in-tag": false, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "packages": { + ".": { + "package-name": "platform-vcluster-template" + } + } +}