Skip to content

Commit

Permalink
Merge pull request #133 from sapcc/goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 authored Oct 11, 2023
2 parents 87a76ad + 3ebb214 commit c7dd0c3
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 16 deletions.
19 changes: 12 additions & 7 deletions Makefile.maker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ dockerfile:
golangciLint:
createConfig: true

goReleaser:
createConfig: true

githubWorkflow:
ci:
enabled: true
Expand All @@ -30,6 +33,8 @@ githubWorkflow:
enabled: true
license:
enabled: true
release:
enabled: true
spellCheck:
enabled: true

Expand All @@ -45,12 +50,12 @@ renovate:
enabled: false

verbatim: |
ENVTEST_VERSION := "1.23.x!"
prepare-envtest-binaries:
# Attach `make prepare-envtest-binaries` as a dependency to the autogenerated `make build/cover.out`.
build/cover.out: prepare-envtest-binaries
ENVTEST_VERSION := "1.26.x!"
prepare-envtest-binaries: FORCE
printf "\e[1;36m>> Preparing envtest binaries...\e[0m\n"
@if ! hash setup-envtest 2>/dev/null; then printf "\e[1;36m>> Installing setup-envtest...\e[0m\n"; go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest; fi
@mkdir -p test/bin
setup-envtest --arch=amd64 --bin-dir test/bin use $(ENVTEST_VERSION)
build/release-info: CHANGELOG.md | build
@if ! hash release-info 2>/dev/null; then printf "\e[1;36m>> Installing release-info...\e[0m\n"; go install github.com/sapcc/go-bits/tools/release-info@latest; fi
release-info $< $(shell git describe --tags --abbrev=0) > $@
setup-envtest --bin-dir test/bin use $(ENVTEST_VERSION)
50 changes: 41 additions & 9 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,45 @@
# Release Guide

1. Ensure local `master` branch is up to date with `origin/master`.
2. Create the Evntest environment with `make prepare-envtest-binaries`. Ensure all checks are passing: `make check`.
3. Update the [`changelog`](./CHANGELOG.md). Make sure that the format is consistent
especially the version heading. We follow [semantic versioning][semver] for our
releases.
4. Commit the updated changelog with message: `Release <version>` .
5. Create and push a new Git tag: note that we prefix our Git tags with `v` .
6. [Draft](https://github.com/sapcc/absent-metrics-operator/releases/new) a new release
for the new tag. Use the release notes from the changelog as the release's description.
We use [GoReleaser][goreleaser] and GitHub workflows for automating the release
process. Follow the instructions below for creating a new release.

1. Ensure local `master` branch is up to date with `origin/master`:

```sh
git fetch --tags && git pull --tags
```

2. Ensure all checks are passing:

```sh
make check
```

3. Update the [`CHANGELOG`](./CHANGELOG.md).
Make sure that the format is consistent especially the version heading.
We follow [semantic versioning][semver] for our releases.

You can check if the file format is correct by running [`release-info`][release-info] for the new version:

```sh
go install github.com/sapcc/go-bits/tools/release-info@latest
release-info CHANGELOG.md X.Y.Z
```

where `X.Y.Z` is the version that you are planning to release.

4. Commit the updated changelog with message: `Release <version>`
5. Create and push a new Git tag:

```sh
git tag vX.Y.Z
git push --tags
```

> [!IMPORTANT]
> Tags are prefixed with `v` and the GitHub release workflow is triggered for tags that match the `v[0-9]+.[0-9]+.[0-9]+` [gh-pattern].
[release-info]: https://github.com/sapcc/go-bits/tree/master/tools/release-info
[semver]: https://semver.org/spec/v2.0.0.html
[gh-pattern]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#patterns-to-match-branches-and-tags
[goreleaser]: https://github.com/goreleaser/goreleaser

0 comments on commit c7dd0c3

Please sign in to comment.