From eac7fe07ab8b02f0ddd63979b78476203cf37ea3 Mon Sep 17 00:00:00 2001 From: Alexandre Vilain Date: Thu, 28 Dec 2023 10:58:12 +0100 Subject: [PATCH] feat(helm): add release action --- .github/workflows/release-chart.yaml | 52 ++++++++++++++++++++++++++++ Makefile | 2 +- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-chart.yaml diff --git a/.github/workflows/release-chart.yaml b/.github/workflows/release-chart.yaml new file mode 100644 index 00000000..72812302 --- /dev/null +++ b/.github/workflows/release-chart.yaml @@ -0,0 +1,52 @@ +name: Release Charts + +on: + push: + branches: + # - main + - feat/helm-release-action + +env: + GO_VERSION: "1.21.5" + +jobs: + release: + ## if: startsWith(github.ref, 'refs/tags/chart-v') == true + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + check-latest: true + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Generate operator chart + run: make helm + + - name: Install Helm + uses: azure/setup-helm@v3 + + - name: Create releaser configuration + run: | + cat < cr.yaml + release-name-template: "chart-{{ .Version }}" + make-release-latest: false + EOF + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.6.0 + with: + charts_dir: charts + config: cr.yaml + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/Makefile b/Makefile index d40e5655..9baadd1b 100644 --- a/Makefile +++ b/Makefile @@ -170,7 +170,7 @@ artifacts: kustomize $(KUSTOMIZE) build config/default > ${RELEASE_PATH}/temporal-operator.yaml .PHONY: helm -helm: manifests +helm: manifests artifacts cp ${RELEASE_PATH}/temporal-operator.crds.yaml charts/temporal-operator/crds .PHONY: bundle