Skip to content

Commit

Permalink
small changes to release to GH
Browse files Browse the repository at this point in the history
Signed-off-by: Mohamed Belgaied Hassine <[email protected]>
  • Loading branch information
belgaied2 committed Dec 22, 2023
1 parent a2db53c commit 27fb2c7
Show file tree
Hide file tree
Showing 2 changed files with 420 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ TOOLS_BIN_DIR := $(abspath $(TOOLS_DIR)/$(BIN_DIR))

export PATH := $(abspath $(TOOLS_BIN_DIR)):$(PATH)

# GITHUB
GH_VERSION := v2.40.1
GH_BIN := gh
GH := $(abspath $(TOOLS_BIN_DIR)/$(GH_BIN))
# Repo
GH_ORG_NAME ?= $ORG
GH_REPO_NAME ?= cluster-api-provider-harvester
GH_REPO ?= $(GH_ORG_NAME)/$(GH_REPO_NAME)

.PHONY: all
all: build

Expand Down Expand Up @@ -257,7 +266,7 @@ release-notes: $(RELEASE_DIR) $(GH)
if [ -n "${PRE_RELEASE}" ]; then \
echo ":rotating_light: This is a RELEASE CANDIDATE. Use it only for testing purposes. If you find any bugs, file an [issue](https://github.com/rancher-sandbox/cluster-api-provider-harvester/issues/new)." > $(RELEASE_DIR)/CHANGELOG.md; \
else \
$(GH) api repos/$(ORG)/$(GH_REPO_NAME)/releases/generate-notes -F tag_name=$(VERSION) -F previous_tag_name=$(PREVIOUS_VERSION) --jq '.body' > $(RELEASE_DIR)/CHANGELOG.md; \
$(GH) api repos/$(ORG)/$(GH_REPO_NAME)/releases/generate-notes -F tag_name=$(RELEASE_TAG) -F previous_tag_name=$(PREVIOUS_TAG) --jq '.body' > $(RELEASE_DIR)/CHANGELOG.md; \
fi

##@ Build Dependencies
Expand Down Expand Up @@ -327,3 +336,8 @@ clean-release-git: ## Restores the git files usually modified during a release
.PHONY: clean-generated-yaml
clean-generated-yaml: ## Remove files generated by conversion-gen from the mentioned dirs. Example SRC_DIRS="./api/v1alpha4"
(IFS=','; for i in $(SRC_DIRS); do find $$i -type f -name '*.yaml' -exec rm -f {} \;; done)

$(GH): # Download GitHub cli into the tools bin folder
hack/ensure-gh.sh \
-b $(TOOLS_BIN_DIR) \
$(GH_VERSION)
Loading

0 comments on commit 27fb2c7

Please sign in to comment.