Skip to content

Commit

Permalink
Complete automate release versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
janos committed Nov 3, 2020
1 parent 0c09ffc commit f28ed63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ We'd love to accept your patches and contributions to this project. There are ju
1. Code should be `go fmt` formatted.
2. Exported types, constants, variables and functions should be documented.
3. Changes must be covered with tests.
4. All tests must pass constantly `go test .`.
4. All tests must pass constantly by running the `make` command.

## Versioning

Expand All @@ -15,8 +15,6 @@ Compromised service follows semantic versioning. New functionality should be acc

Any code which is complete, tested, reviewed, and merged to master can be released.

1. Update the `version` number in `version.go`.
2. Make a pull request with these changes.
3. Once the pull request has been merged, visit [https://github.com/janos/compromised/releases](https://github.com/janos/compromised/release) and click `Draft a new release`.
4. Update the `Tag version` and `Release title` field with the new Compromised CLI version. Be sure the version has a `v` prefixed in both places, e.g. `v1.25.0`.
5. Publish the release.
Releasing a new version is automated with goreleaser and GitHub Actions.

To release, only a tag with semantic version and a prefix `v` should be pushed to the repository on GitHub, e.g. `v1.25.0`.
4 changes: 2 additions & 2 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
package compromised

var (
version = "0.1.0" // manually set semantic version number
version = "0.0.0" // automatically set on release
commit string // automatically set git commit hash

Version = func() string {
if commit != "" {
return version + "-" + commit
}
return version + "-dev"
return version
}()
)

0 comments on commit f28ed63

Please sign in to comment.