From 63681560fe0ea896121e3b76733510894c6a7461 Mon Sep 17 00:00:00 2001 From: Andrew Karpow Date: Wed, 11 Mar 2026 14:58:49 -0400 Subject: [PATCH] new helm oci step --- .github/workflows/helm-oci-package-ghcr.yaml | 40 ++++++++++++++++ .github/workflows/publish-helm.yml | 48 -------------------- Makefile.maker.yaml | 3 ++ 3 files changed, 43 insertions(+), 48 deletions(-) create mode 100644 .github/workflows/helm-oci-package-ghcr.yaml delete mode 100644 .github/workflows/publish-helm.yml diff --git a/.github/workflows/helm-oci-package-ghcr.yaml b/.github/workflows/helm-oci-package-ghcr.yaml new file mode 100644 index 00000000..2e11ac1d --- /dev/null +++ b/.github/workflows/helm-oci-package-ghcr.yaml @@ -0,0 +1,40 @@ +################################################################################ +# This file is AUTOGENERATED with # +# Edit Makefile.maker.yaml instead. # +################################################################################ + +# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company +# SPDX-License-Identifier: Apache-2.0 + +name: Helm OCI Package GHCR +"on": + push: + branches: + - new-helm-oci + tags: + - '*' + workflow_dispatch: {} +permissions: + contents: read + packages: write +jobs: + build-and-push-helm-package: + name: Build and publish Helm Chart OCI + runs-on: large_runner_16core_64gb + steps: + - name: Check out code + uses: actions/checkout@v6 + - name: Install Helm + uses: azure/setup-helm@v4.3.1 + - name: Lint Helm Chart + run: helm lint charts/openstack-hypervisor-operator + - name: Package Helm Chart + run: helm package charts/openstack-hypervisor-operator --destination ./chart + - name: Log in to the Container registry + uses: docker/login-action@v4 + with: + password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io + username: ${{ github.actor }} + - name: Push Helm Chart to ghcr.io + run: helm push ./chart/*.tgz oci://ghcr.io/${{ github.repository_owner }}/charts diff --git a/.github/workflows/publish-helm.yml b/.github/workflows/publish-helm.yml deleted file mode 100644 index da9ce2ce..00000000 --- a/.github/workflows/publish-helm.yml +++ /dev/null @@ -1,48 +0,0 @@ -# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company -# SPDX-License-Identifier: Apache-2.0 - -name: Publish Helm Chart GHCR -"on": - push: - branches: - - main - paths: - - 'charts/**' - workflow_dispatch: {} - - -jobs: - publish-chart: - runs-on: ubuntu-latest - permissions: - contents: write # Required for pushing the repository - packages: write # Required to push to GHCR - - steps: - - name: Checkout repository - uses: actions/checkout@v5 - - - name: Install Helm - uses: azure/setup-helm@v4.3.1 - - - name: Bump Helm Chart - uses: pluralsh/chart-releaser@v0.1.3 - with: - path: ./charts/openstack-hypervisor-operator/ - release: "0.1.0" - branch: main - github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Package Helm chart - run: | - helm package ./charts/openstack-hypervisor-operator - - - name: Log in to GHCR - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin - - - name: Push Helm chart to GHCR - run: | - CHART_NAME=openstack-hypervisor-operator - CHART_VERSION=$(grep "version:" ./charts/${CHART_NAME}/Chart.yaml | awk '{print $2}') - helm push "${CHART_NAME}-${CHART_VERSION}.tgz" "oci://ghcr.io/${{ github.repository_owner }}/charts" diff --git a/Makefile.maker.yaml b/Makefile.maker.yaml index 34121e01..79fa3526 100644 --- a/Makefile.maker.yaml +++ b/Makefile.maker.yaml @@ -42,6 +42,9 @@ githubWorkflow: - latest - semver - sha + pushHelmChartToGhcr: + path: charts/openstack-hypervisor-operator + lint: true license: enabled: true