From 9e8c2be72e75874c5ea00d1fe8cb60891f0ac07c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Wed, 13 Dec 2023 23:42:51 +0100 Subject: [PATCH] Publish helm charts as OCI artifact MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan-Otto Kröpke --- .github/workflows/release.yaml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7b9b5c8..ac72fb7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,6 +7,9 @@ on: jobs: release: + permissions: + contents: write + packages: write runs-on: ubuntu-latest steps: - name: Checkout @@ -22,7 +25,7 @@ jobs: - name: Install Helm uses: azure/setup-helm@v3 with: - version: v3.10.3 + version: v3.13.3 - name: Add Helm repositories run: | @@ -35,3 +38,21 @@ jobs: env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" CR_GENERATE_RELEASE_NOTES: true + + # see https://github.com/helm/chart-releaser/issues/183 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push Charts to GHCR + run: | + shopt -s nullglob + for pkg in .cr-release-packages/*; do + if [ -z "${pkg:-}" ]; then + break + fi + helm push "${pkg}" oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts + done