2017-09-10 22:07:28 +02:00
|
|
|
---
|
2017-10-01 18:57:52 +02:00
|
|
|
title: Releasing
|
2017-09-10 22:07:28 +02:00
|
|
|
---
|
|
|
|
|
2017-10-01 18:57:52 +02:00
|
|
|
GoReleaser will create a release in GitHub with the current tag, upload all
|
|
|
|
the archives and checksums, also generate a changelog from the commits new since the last tag.
|
2017-09-10 22:07:28 +02:00
|
|
|
|
|
|
|
Let's see what can be customized in the `release` section:
|
|
|
|
|
|
|
|
```yml
|
|
|
|
# .goreleaser.yml
|
|
|
|
release:
|
|
|
|
# Repo in which the release will be created.
|
|
|
|
# Default is extracted from the origin remote URL.
|
|
|
|
github:
|
|
|
|
owner: user
|
|
|
|
name: repo
|
|
|
|
|
|
|
|
# If set to true, will not auto-publish the release.
|
2017-10-01 18:57:52 +02:00
|
|
|
# Default is false.
|
2017-09-10 22:07:28 +02:00
|
|
|
draft: true
|
2017-10-05 15:47:29 +02:00
|
|
|
|
|
|
|
# If set to true, will mark the release as not ready for production.
|
|
|
|
# Default is false.
|
|
|
|
prerelease: true
|
2017-10-07 11:31:14 +02:00
|
|
|
|
2017-10-16 21:18:53 +02:00
|
|
|
# You can change the name of the GitHub release.
|
2017-10-07 22:32:04 +02:00
|
|
|
# This is parsed with the Go template engine and the following variables
|
|
|
|
# are available:
|
|
|
|
# - ProjectName
|
|
|
|
# - Tag
|
|
|
|
# - Version (Git tag without `v` prefix)
|
|
|
|
# Default is ``
|
2017-10-07 11:31:14 +02:00
|
|
|
name_template: "{{.ProjectName}}-v{{.Version}}"
|
2017-09-10 22:07:28 +02:00
|
|
|
```
|
|
|
|
|
2017-10-16 14:50:11 +02:00
|
|
|
## Customize the changelog
|
|
|
|
|
|
|
|
You can customize how the changelog is generated using the
|
|
|
|
`changelog` section in the config file:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
# .goreleaser.yml
|
|
|
|
changelog:
|
|
|
|
filters:
|
2017-10-18 03:45:19 +02:00
|
|
|
# commit messages matching the regexp listed here will be removed from
|
2017-10-16 14:50:11 +02:00
|
|
|
# the changelog
|
2017-10-20 00:44:12 +02:00
|
|
|
# Default is emtpy
|
2017-10-16 14:50:11 +02:00
|
|
|
exclude:
|
2017-10-18 03:45:19 +02:00
|
|
|
- '^docs:'
|
2017-10-16 14:50:11 +02:00
|
|
|
- typo
|
2017-10-18 03:45:19 +02:00
|
|
|
- (?i)foo
|
2017-10-20 00:44:12 +02:00
|
|
|
# could either be asc, desc or empty
|
|
|
|
# Default is empty
|
|
|
|
sort: asc
|
2017-10-16 14:50:11 +02:00
|
|
|
```
|
|
|
|
|
2017-09-10 22:07:28 +02:00
|
|
|
## Custom release notes
|
|
|
|
|
2017-10-01 18:57:52 +02:00
|
|
|
You can specify a file containing your custom release notes, and
|
|
|
|
pass it with the `--release-notes=FILE` flag.
|
2017-09-10 22:07:28 +02:00
|
|
|
GoReleaser will then skip its own release notes generation,
|
|
|
|
using the contents of your file instead.
|
2017-10-01 18:57:52 +02:00
|
|
|
You can use Markdown to format the contents of your file.
|
2017-09-30 22:37:11 +02:00
|
|
|
|
2017-10-16 14:50:11 +02:00
|
|
|
On Unix systems you can also generate the release notes in-line by using
|
|
|
|
[process substitution](https://en.wikipedia.org/wiki/Process_substitution).
|
|
|
|
To list all commits since the last tag, but skip ones starting with `Merge` or
|
|
|
|
`docs`, you could run this command:
|
2017-09-30 22:37:11 +02:00
|
|
|
|
|
|
|
```sh
|
|
|
|
goreleaser --release-notes <(git log --pretty=oneline --abbrev-commit $(git describe --tags --abbrev=0)^.. | grep -v '^[^ ]* \(Merge\|docs\)')
|
|
|
|
```
|