Skip to content

Commit

Permalink
chore: add DEVELOPMENT.md and release instructions (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
kilianc committed Jun 29, 2024
1 parent 15f7104 commit 38c1188
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
42 changes: 42 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -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 <file>..." to update what will be committed)
(use "git restore <file>..." 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.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down Expand Up @@ -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 ""
Expand Down

0 comments on commit 38c1188

Please sign in to comment.