Skip to content

Commit

Permalink
Merge pull request #87 from philips-labs/release-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Brend-Smits authored Nov 11, 2021
2 parents 153a9dc + 2ca9be8 commit f1d82ec
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,21 @@ 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 -u
@echo Bumping $(OLD_VERSION) to $(NEW_VERSION)
@sed -i 's/$(OLD_VERSION)/$(NEW_VERSION)/g' .github/workflows/*.yaml *.yaml *.md
@git add .
@git commit -s -m "Bump $(OLD_VERSION) to $(NEW_VERSION) for release"
@git tag -sam "$(DESCRIPTION)" $(NEW_VERSION)
@git push $(NEW_VERSION)
@echo ATTENTION: MANUAL ACTION REQUIRED!! -- Wait for the release workflow to finish
@echo
@echo Check status here https://github.com/philips-labs/slsa-provenance-action/actions/workflows/ci.yaml
@echo
@echo Once finished, push the main branch using 'git push'
@echo
@git stash pop

31 changes: 31 additions & 0 deletions release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Release procedures

## Automated release procedure

To make a new release you can make use of the following `make` task.

```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` the version that you want to release.
`OLD_VERSION` the current version you wish to replace in the markdown and yaml files.
`DESCRIPTION` the annotation used when tagging the release.

### ⚠ Important alert for MacOS users ⚠

On MacOS `sed` has different behaviour and therefore doesn't work out of the box.
A workaround to make it work is to install gnu-sed and alias it in your bashrc/zshrc:

```bash
brew install gnu-sed
echo "alias sed=gsed" >> ~/.zshrc
```

## 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`.
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 f1d82ec

Please sign in to comment.