From 38c1188d20acd6560436447d0e3d38939eaa9ca4 Mon Sep 17 00:00:00 2001 From: Kilian Ciuffolo <385716+kilianc@users.noreply.github.com> Date: Sat, 29 Jun 2024 15:56:30 -0700 Subject: [PATCH] chore: add `DEVELOPMENT.md` and release instructions (#90) --- DEVELOPMENT.md | 42 ++++++++++++++++++++++++++++++++++++++++++ Makefile | 10 ++++++++++ 2 files changed, 52 insertions(+) create mode 100644 DEVELOPMENT.md diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..7e54062 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,42 @@ +# Release Process + +Pick a new version: + +```sh +export NEW_VERSION="v1.x.x" +``` + +Update all version strings: + +```sh +make version-bump version=${NEW_VERSION} +``` + +Update `CHANGELOG.md`: + +```sh +make changelog tag=${NEW_VERSION} +``` + +Check changes and commit/push: + +```sh +git status +git add . +git commit -m "chore: bump version to ${NEW_VERSION}" +``` + +You should see something similar to: + +```console +On branch feat/foobar +Changes not staged for commit: + (use "git add ..." to update what will be committed) + (use "git restore ..." to discard changes in working directory) + modified: CHANGELOG.md + modified: Makefile + modified: README.md + modified: cmd/pretender/main.go +``` + +Create a new GitHub release using the value in `${NEW_VERSION}` as name and tag. The new release will trigger the automation to upload the binaries and push a docker image to DockerHub. diff --git a/Makefile b/Makefile index c5fb6b1..d06870e 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ GOFUMPT_VERSION := v0.6.0 GOLANGCI_LINT_VERSION := v1.57.2 RESPONSES_FILE ?= examples/example.json BINARY_NAME := pretender +BINARY_VERSION := v1.8.0 OS_LIST := darwin linux ARCH_LIST := arm64 amd64 BUILD_TARGETS := $(foreach os,$(OS_LIST),$(foreach arch,$(ARCH_LIST),bin/$(BINARY_NAME)-$(os)-$(arch))) @@ -96,6 +97,15 @@ changelog: bin/git-chglog @git fetch --tags > /dev/null 2>&1 @bin/git-chglog --no-emoji -o CHANGELOG.md --next-tag $(tag) +version-bump: + @echo "" + @echo "bumping version to $(version)" + @find . \ + -path ./.git -prune -o \ + -type f \ + -exec ex -sc '%s/$(BINARY_VERSION)/$(version)/g' -c 'x' {} \; + @git status + .PHONY: version-check version-check: @echo ""