From 3f59bf2cb5f552ae478b343d77255b4e85a72cb0 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Tue, 24 Oct 2023 11:35:12 +0200 Subject: [PATCH] =?UTF-8?q?Add=20a=20prepare-release=20target=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … and update the version to 0.1.0 to prepare the release to come. Signed-off-by: Vincent Demeester --- Chart.yaml | 4 ++-- Makefile | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index 6203283..8726ca0 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 name: task-git -version: 0.0.1 +version: 0.1.0 description: | This Task represents Git and is able to initialize and clone a remote repository on the informed Workspace. It's likely to become the first `step` on a Pipeline. -type: application \ No newline at end of file +type: application diff --git a/Makefile b/Makefile index 8067350..0a6e863 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ # using the chart name and version from chart's metadata CHART_NAME ?= $(shell awk '/^name:/ { print $$2 }' Chart.yaml) -CHART_VESION ?= $(shell awk '/^version:/ { print $$2 }' Chart.yaml) +CHART_VERSION ?= $(shell awk '/^version:/ { print $$2 }' Chart.yaml) + +# release directory where the Tekton resources are rendered into. +RELEASE_DIR ?= /tmp/$(CHART_NAME)-$(CHART_VERSION) # bats entry point and default flags BATS_CORE = ./test/.bats/bats-core/bin/bats @@ -30,6 +33,18 @@ helm-template: install: $(call render-template) |kubectl $(ARGS) apply -f - +# pepare a release +prepare-release: + mkdir -p $(RELEASE_DIR)/task/$(CHART_NAME) || true + helm template $(ARGS) . > $(RELEASE_DIR)/task/$(CHART_NAME)/$(CHART_NAME).yaml + cp README.md $(RELEASE_DIR)/task/$(CHART_NAME)/ + go run github.com/openshift-pipelines/tektoncd-catalog/cmd/catalog-cd@main release --output release --version $(CHART_VERSION) $(RELEASE_DIR)/task/$(CHART_NAME) + @echo "Now you can release:" + @echo " git tag v$(CHART_VERSION) && git push v$(CHART_VERSION)" + @echo " gh release create v$(CHART_VERSION) --generate-notes" + @echo " gh release upload v$(CHART_VERSION) release/catalog.yaml" + @echo " gh release upload v$(CHART_VERSION) release/resources.tar.gz" + # packages the helm-chart as a single tarball, using it's name and version to compose the file helm-package: clean helm package $(ARGS) . @@ -53,4 +68,4 @@ test-e2e: install # and end-to-end) to avoid running the release workflow accidently act: ARGS = --workflows=./.github/workflows/test.yaml act: - act $(ARGS) \ No newline at end of file + act $(ARGS)