1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/docs/123-release.md
Dominik Schulz c0379ed858 feat: Provide time template func
This commit adds a customizable time function to the release name
template.
2018-04-01 15:19:32 -03:00

81 lines
2.2 KiB
Markdown

---
title: Release
---
GoReleaser will create a GitHub release with the current tag, upload all
the artifacts and generate the changelog based on the new commits since the
previous tag.
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.
# Default is false.
draft: true
# If set to true, will mark the release as not ready for production.
# Default is false.
prerelease: true
# You can change the name of the GitHub release.
# This is parsed with the Go template engine and the following variables
# are available:
# - ProjectName
# - Tag
# - Version (Git tag without `v` prefix)
# There is also a template function "time" that takes a Go time format
# string to insert a formated timestamp into the release name.
# Default is ``
name_template: "{{.ProjectName}}-v{{.Version}}"
```
## Customize the changelog
You can customize how the changelog is generated using the
`changelog` section in the config file:
```yaml
# .goreleaser.yml
changelog:
filters:
# commit messages matching the regexp listed here will be removed from
# the changelog
# Default is empty
exclude:
- '^docs:'
- typo
- (?i)foo
# could either be asc, desc or empty
# Default is empty
sort: asc
```
## Custom release notes
You can specify a file containing your custom release notes, and
pass it with the `--release-notes=FILE` flag.
GoReleaser will then skip its own release notes generation,
using the contents of your file instead.
You can use Markdown to format the contents of your file.
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:
```console
$ goreleaser --release-notes <(some_changelog_generator)
```
Some changelog generators you can use:
* [buchanae/github-release-notes](https://github.com/buchanae/github-release-notes)