From 03e931d2037b1204de0ae5dcd5bb7ad98cbdafbf Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Fri, 13 Nov 2020 17:54:11 +0100 Subject: [PATCH] Release charts manually This replicates the process used in the old Travis configuration to publish updated charts. Signed-off-by: Stephen Kitt --- .github/workflows/release.yml | 13 +++++++++---- Makefile | 22 +++++++++++++++++++++- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ffc4385..2989e8c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,12 @@ jobs: git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.1.0 - env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + - name: Update the charts + run: | + make release + + - name: Push the charts + run: | + git add charts/* + git commit -m "Chart update" + git push diff --git a/Makefile b/Makefile index 4a18c2f..4276c5e 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,10 @@ CLUSTER_SETTINGS_FLAG = --cluster_settings $(DAPPER_SOURCE)/cluster_settings override CLUSTERS_ARGS += $(CLUSTER_SETTINGS_FLAG) override DEPLOY_ARGS += $(CLUSTER_SETTINGS_FLAG) --deploytool helm --deploytool_broker_args '--set submariner.serviceDiscovery=true' export DEPLOY_ARGS +GH_URL=https://submariner-io.github.io/submariner-charts/charts +CHARTS_DIR=charts +CHARTS_VERSION=0.7.0 +REPO_URL=$(shell git config remote.origin.url) # Targets to make @@ -24,7 +28,23 @@ preload-images: import_image quay.io/submariner/$${image}; \ done -.PHONY: preload-images +$(CHARTS_DIR): + mkdir -p $(CHARTS_DIR) + +$(CHARTS_DIR)/%: $(CHARTS_DIR) + helm dep update $(subst -$(CHARTS_VERSION),,$(basename $(@F))) + helm package --version $(CHARTS_VERSION) $(subst -$(CHARTS_VERSION),,$(basename $(@F))) + mv -f $(@F) $@ + +release: $(CHARTS_DIR)/submariner-$(CHARTS_VERSION).tgz $(CHARTS_DIR)/submariner-k8s-broker-$(CHARTS_VERSION).tgz $(CHARTS_DIR)/submariner-operator-$(CHARTS_VERSION).tgz + git checkout gh-pages + if [ -f $(CHARTS_DIR)/index.yaml ]; then \ + helm repo index $(CHARTS_DIR) --url $(GH_URL) --merge $(CHARTS_DIR)/index.yaml; \ + else \ + helm repo index $(CHARTS_DIR) --url $(GH_URL); \ + fi + +.PHONY: preload-images release else