Skip to content

Commit

Permalink
Add make command to automate release procedure
Browse files Browse the repository at this point in the history
Co-authored-by: Marco Franssen <marco.franssen@philips.com>
Signed-off-by: Brend Smits <brend.smits@philips.com>
  • Loading branch information
Brend-Smits and marcofranssen committed Nov 11, 2021
1 parent 33cb940 commit 60854d2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,16 @@ release: $(GO_PATH)/bin/goreleaser ## creates a release using goreleaser
.PHONY: release-vars
release-vars: ## print the release variables for goreleaser
@echo export LDFLAGS=\"$(LDFLAGS)\"

.PHONY: gh-release
gh-release: ## Creates a new release by creating a new tag and pushing it
git stash
sed -i 's/$(OLD_VERSION)/$(NEW_VERSION)/g' .github/workflows/*.yaml
sed -i 's/$(OLD_VERSION)/$(NEW_VERSION)/g' *.yaml *.md
git add .
git commit -s -m "$(DESCRIPTION)"
git tag -sam "$(DESCRIPTION)" $(NEW_VERSION)
git push $(NEW_VERSION)
@echo ATTENTION: MANUAL ACTION REQUIRED!! -- Wait for the release workflow to finish, then push the main branch using git push
git stash pop

18 changes: 14 additions & 4 deletions release.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# Release
# Automated release procedure

A make script has been created to automate the manual procedure.
Execute the following command:
```bash
make gh-release NEW_VERSION=v0.6.0 OLD_VERSION=v0.5.0 DESCRIPTION="A test release to see how it works"
```

`NEW_VERSION` is the version that you want to release.
`OLD_VERSION` is the previous version you wish to overwrite in the markdown and yaml files.
`DESCRIPTION` is the description to use in the annotation of the tag and commit description.

# Manual release procedure

1. Upgrade version number in all repository files, find & replace previous version number with new version number.
1. Commit the changed files.
1. Tag the new commit using `git tag -sam "What is this release about?" v0.1.0`.

## Experimental

1. Push the tag to remote using `git push v0.1.0`
1. Wait for the release workflow to finish, then push the main branch using `git push`

0 comments on commit 60854d2

Please sign in to comment.