From ac308b4d5f6fd5bb93488262d0c87f129b47f247 Mon Sep 17 00:00:00 2001 From: Admir Trakic Date: Mon, 27 Feb 2023 11:05:37 +0100 Subject: [PATCH] feat: add release make target --- Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9ccfec9..b5de6e9 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ sync reconcile: ## Sync flux reconcile kustomization apps --with-source flux get all --all-namespaces -clean: ## Clean up +clean: ## Clean up echo ":: $(green)$@$(reset) :: " kind delete cluster @@ -78,8 +78,17 @@ test: ## Test demo app release: ## Release (eg. V=0.0.1) @[ "$(V)" ] \ && read -p "Press enter to confirm and push tag v$(V) to origin, to abort ..." \ - && git tag v$(V) -m "v$(V)" \ - && git push origin v$(V) + && git tag v$(V) -m "chore: v$(V)" \ + && git push origin v$(V) -f \ + && git fetch --tags --force --all -p \ + && if [ ! -z "$(GITHUB_TOKEN)" ] ; then \ + curl \ + -H "Authorization: token $(GITHUB_TOKEN)" \ + -X POST \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/$(GITHUB_USER)/$(shell basename $$PWD)/releases \ + -d "{\"tag_name\":\"$(V)\",\"generate_release_notes\":true}"; \ + fi; help: ## Display this help menu echo ":: $(green)$@$(reset) :: "