1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/www/content/release.md
Manuel Vogel eb7ba2a294 feat: add gitlab for releases (#1038)
* outlines gitlab client integration

* makes client parameter more explicit

* adds gitlab url to config

* changes releaseID to string to adapt to gitlab

* updates to latest gitlab client lib 0.18

* fixes copy paster in gitlab upload func

* fixes gitlab typo in config

* adds gitlab token to env and context

* release now uses the client factory method

* skips brew pipe if it is not a github release

* add github tokentype to publish tests

* skips scoop pipe if it is not a github release

* corrects brew skip msg

* adds gitlab token to main test

* adds gitlab to release docs

* validates config and errors accordingly

* adapt release pipe name to include gitlab

* fixes gitlab client after testing

* moves not-configured brew and scoop pipe checks as first check

* adds more debug to gitlab client

* adapts changelog generation for gitlab markdown

* adds debug log for gitlab changelog

* env needs to run before changelog pipe

* moves gitlab default download url to default pipe

* moves multiple releases check to from config to release pipe

* release differs now for github and gitlab

* adds debug gitlab release update msgs

* moves env pipe as second after before because it determines the token type other pipes depend on

* adaptes error check on gitlab release creation

* Revert "adaptes error check on gitlab release creation"

This reverts commit 032024571c.

* simplifies gitlab client logic. removes comments

* skips tls verification for gitlab client if specified in config

* updates the docs

* adds clarification that brew and scoop are not supported if it is a gitlab release

* fixes copy paster in release.md

* adds missing blob pipe in defaults and publish due to missing in merge

* updates comment in gitlab client
2019-06-29 11:02:40 -03:00

3.2 KiB

title series hideFromIndex weight
Release customization true 110

GoReleaser will create a GitHub/GitLab 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 for GitHub:

# .goreleaser.yml
release:
  # Repo in which the release will be created.
  # Default is extracted from the origin remote URL.
  # Note: it can only be one: either github or gitlab
  github:
    owner: user
    name: repo

  # If set to true, will not auto-publish the release.
  # Default is false.
  draft: true

  # If set to auto, will mark the release as not ready for production
  # in case there is an indicator for this in the tag e.g. v1.0.0-rc1
  # If set to true, will mark the release as not ready for production.
  # Default is false.
  prerelease: auto

  # You can change the name of the GitHub release.
  # Default is `{{.Tag}}`
  name_template: "{{.ProjectName}}-v{{.Version}} {{.Env.USER}}"

  # You can disable this pipe in order to not upload any artifacts to
  # GitHub.
  # Defaults to false.
  disable: true

Seconds let's see what can be customized in the release section for GitLab:

# .goreleaser.yml
release:
  # Same as for github
  # Note: it can only be one: either github or gitlab
  gitlab:
    owner: user
    name: repo

  # You can change the name of the GitLab release.
  # Default is `{{.Tag}}`
  name_template: "{{.ProjectName}}-v{{.Version}} {{.Env.USER}}"

  # You can disable this pipe in order to not upload any artifacts to
  # GitLab.
  # Defaults to false.
  disable: true

Note: draft and prerelease is only supported by GitHub.

Learn more about the name template engine.

Customize the changelog

You can customize how the changelog is generated using the changelog section in the config file:

# .goreleaser.yml
changelog:
  # set it to true if you wish to skip the changelog generation
  skip: true
  # could either be asc, desc or empty
  # Default is empty
  sort: asc
  filters:
    # commit messages matching the regexp listed here will be removed from
    # the changelog
    # Default is empty
    exclude:
      - '^docs:'
      - typo
      - (?i)foo

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. To list all commits since the last tag, but skip ones starting with Merge or docs, you could run this command:

$ goreleaser --release-notes <(some_changelog_generator)

Some changelog generators you can use:

Important

: If you create the release before running GoReleaser, and the said release has some text in its body, GoReleaser will not override it with it's release notes.