1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

docs: improve customization section (#2507)

* docs: improve customization section

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: improve docs

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: ignore edit urls in htmltest

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker 2021-09-27 22:43:00 -03:00 committed by GitHub
parent 608d48ab30
commit 164d462470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 287 additions and 269 deletions

View File

@ -1,215 +0,0 @@
---
title: Announce
---
GoReleaser can also announce new releases to Twitter, Reddit, Slack, Discourse and Microsoft Teams.
It runs at the very end of the pipeline and can be skipped with the `--skip-announce` flag of
the [`release`](/cmd/goreleaser_release/) command.
## Twitter
For it to work, you'll need to [create a new Twitter app](https://developer.twitter.com/en/portal/apps/new), and set
some environment variables on your pipeline:
- `TWITTER_CONSUMER_KEY`
- `TWITTER_CONSUMER_SECRET`
- `TWITTER_ACCESS_TOKEN`
- `TWITTER_ACCESS_TOKEN_SECRET`
Then, you can add something like the following to your `.goreleaser.yml` config:
```yaml
# .goreleaser.yml
announce:
twitter:
# Whether its enabled or not.
# Defaults to false.
enabled: true
# Message template to use while publishing.
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .GitURL }}/releases/tag/{{ .Tag }}`
message_template: 'Awesome project {{.Tag}} is out!'
```
## Teams
To use [Teams](https://www.microsoft.com/de-de/microsoft-teams/group-chat-software), you need
to [create a Webhook](https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook)
, and set following environment variable on your pipeline:
- `TEAMS_WEBHOOK`
After this, you can add following section to your `.goreleaser.yml` config:
```yaml
# .goreleaser.yml
announce:
teams:
# Whether its enabled or not.
# Defaults to false.
enabled: true
# Title template to use while publishing.
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out!`
title_template: 'GoReleaser {{ .Tag }} was just released!'
# Message template to use while publishing.
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .GitURL }}/releases/tag/{{ .Tag }}`
message_template: 'Awesome project {{.Tag}} is out!'
# Color code of the message. You have to use hexadecimal.
# Defaults to `#2D313E` - the grey-ish from goreleaser
color: ''
# URL to an image to use as the icon for the message.
# Defaults to `https://goreleaser.com/static/avatar.png`
icon_url: ''
```
## Discord
To use [Discord](https://discord.com/), you need
to [create a Webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks), and set following
environment variables on your pipeline:
- `DISCORD_WEBHOOK_ID`
- `DISCORD_WEBHOOK_TOKEN`
After this, you can add following section to your `.goreleaser.yml` config:
```yaml
# .goreleaser.yml
announce:
discord:
# Whether its enabled or not.
# Defaults to false.
enabled: true
# Message template to use while publishing.
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .GitURL }}/releases/tag/{{ .Tag }}`
message_template: 'Awesome project {{.Tag}} is out!'
# Set author of the embed.
# Defaults to `GoReleaser`
author: ''
# Color code of the embed. You have to use decimal numeral system, not hexadecimal.
# Defaults to `3888754` - the grey-ish from goreleaser
color: ''
# URL to an image to use as the icon for the embed.
# Defaults to `https://goreleaser.com/static/avatar.png`
icon_url: ''
```
## Slack
For it to work, you'll need to [create a new Incoming Webhook](https://api.slack.com/messaging/webhooks), and set some
environment variables on your pipeline:
- `SLACK_WEBHOOK`
Then, you can add something like the following to your `.goreleaser.yml` config:
```yaml
# .goreleaser.yml
announce:
slack:
# Whether its enabled or not.
# Defaults to false.
enabled: true
# Message template to use while publishing.
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .GitURL }}/releases/tag/{{ .Tag }}`
message_template: 'Awesome project {{.Tag}} is out!'
# The name of the channel that the user selected as a destination for webhook messages.
channel: '#channel'
# Set your Webhook's user name.
username: ''
# Emoji to use as the icon for this message. Overrides icon_url.
icon_emoji: ''
# URL to an image to use as the icon for this message.
icon_url: ''
```
!!! tip Learn more about the [name template engine](/customization/templates/).
## Reddit
For it to work, you'll need to [create a new Reddit app](https://www.reddit.com/prefs/apps), and set some environment
variables on your pipeline:
- `REDDIT_SECRET`
- `REDDIT_PASSWORD`
Then, you can add something like the following to your `.goreleaser.yml` config:
```yaml
# .goreleaser.yml
announce:
reddit:
# Whether its enabled or not.
# Defaults to false.
enabled: true
# Application ID for Reddit Application
application_id: ""
# Username for your Reddit account
username: ""
# URL template to use while publishing.
# Defaults to `{{ .GitURL }}/releases/tag/{{ .Tag }}`
url_template: 'https://github.com/goreleaser/goreleaser/releases/tag/{{ .Tag }}'
# Title template to use while publishing.
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out!`
title_template: ''GoReleaser {{ .Tag }} was just released!''
```
## SMTP
For it to work, you'll need to set some environment variables on your pipeline:
- `SMTP_PASSWORD`
Then, you can add something like the following to your `.goreleaser.yml` config:
```yaml
# .goreleaser.yml
announce:
smtp:
# Whether its enabled or not.
# Defaults to false.
enabled: true
# SMTP Host
host: "smtp.gmail.com"
# SMTP Port
port: 587
# Sender of the email
from: ""
# Receivers of the email
to:
- ""
- ""
# Owner of the email
username: ""
# Body template to use within the email.
# Defaults to `You can view details from: {{ .GitURL }}/releases/tag/{{ .Tag }}`
body_template: 'https://github.com/goreleaser/goreleaser/releases/tag/{{ .Tag }}'
# Subject template to use within the email subject.
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out!`
subject_template: ''GoReleaser {{ .Tag }} was just released!''
```

View File

@ -0,0 +1,38 @@
# Discord
To use [Discord](https://discord.com/), you need
to [create a Webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks), and set following
environment variables on your pipeline:
- `DISCORD_WEBHOOK_ID`
- `DISCORD_WEBHOOK_TOKEN`
After this, you can add following section to your `.goreleaser.yml` config:
```yaml
# .goreleaser.yml
announce:
discord:
# Whether its enabled or not.
# Defaults to false.
enabled: true
# Message template to use while publishing.
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .GitURL }}/releases/tag/{{ .Tag }}`
message_template: 'Awesome project {{.Tag}} is out!'
# Set author of the embed.
# Defaults to `GoReleaser`
author: ''
# Color code of the embed. You have to use decimal numeral system, not hexadecimal.
# Defaults to `3888754` - the grey-ish from goreleaser
color: ''
# URL to an image to use as the icon for the embed.
# Defaults to `https://goreleaser.com/static/avatar.png`
icon_url: ''
```
!!! tip
Learn more about the [name template engine](/customization/templates/).

View File

@ -0,0 +1,5 @@
# Announce
GoReleaser can also announce new releases on social networks, chat rooms and via email!
It runs at the very end of the pipeline and can be skipped with the `--skip-announce` flag of the [`release`](/cmd/goreleaser_release/) command.

View File

@ -0,0 +1,35 @@
# Reddit
For it to work, you'll need to [create a new Reddit app](https://www.reddit.com/prefs/apps), and set some environment
variables on your pipeline:
- `REDDIT_SECRET`
- `REDDIT_PASSWORD`
Then, you can add something like the following to your `.goreleaser.yml` config:
```yaml
# .goreleaser.yml
announce:
reddit:
# Whether its enabled or not.
# Defaults to false.
enabled: true
# Application ID for Reddit Application
application_id: ""
# Username for your Reddit account
username: ""
# URL template to use while publishing.
# Defaults to `{{ .GitURL }}/releases/tag/{{ .Tag }}`
url_template: 'https://github.com/goreleaser/goreleaser/releases/tag/{{ .Tag }}'
# Title template to use while publishing.
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out!`
title_template: ''GoReleaser {{ .Tag }} was just released!''
```
!!! tip
Learn more about the [name template engine](/customization/templates/).

View File

@ -0,0 +1,36 @@
# Slack
For it to work, you'll need to [create a new Incoming Webhook](https://api.slack.com/messaging/webhooks), and set some
environment variables on your pipeline:
- `SLACK_WEBHOOK`
Then, you can add something like the following to your `.goreleaser.yml` config:
```yaml
# .goreleaser.yml
announce:
slack:
# Whether its enabled or not.
# Defaults to false.
enabled: true
# Message template to use while publishing.
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .GitURL }}/releases/tag/{{ .Tag }}`
message_template: 'Awesome project {{.Tag}} is out!'
# The name of the channel that the user selected as a destination for webhook messages.
channel: '#channel'
# Set your Webhook's user name.
username: ''
# Emoji to use as the icon for this message. Overrides icon_url.
icon_emoji: ''
# URL to an image to use as the icon for this message.
icon_url: ''
```
!!! tip
Learn more about the [name template engine](/customization/templates/).

View File

@ -0,0 +1,44 @@
# SMTP
For it to work, you'll need to set some environment variables on your pipeline:
- `SMTP_PASSWORD`
Then, you can add something like the following to your `.goreleaser.yml` config:
```yaml
# .goreleaser.yml
announce:
smtp:
# Whether its enabled or not.
# Defaults to false.
enabled: true
# SMTP Host
host: "smtp.gmail.com"
# SMTP Port
port: 587
# Sender of the email
from: ""
# Receivers of the email
to:
- ""
- ""
# Owner of the email
username: ""
# Body template to use within the email.
# Defaults to `You can view details from: {{ .GitURL }}/releases/tag/{{ .Tag }}`
body_template: 'https://github.com/goreleaser/goreleaser/releases/tag/{{ .Tag }}'
# Subject template to use within the email subject.
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out!`
subject_template: ''GoReleaser {{ .Tag }} was just released!''
```
!!! tip
Learn more about the [name template engine](/customization/templates/).

View File

@ -0,0 +1,37 @@
# Teams
To use [Teams](https://www.microsoft.com/de-de/microsoft-teams/group-chat-software), you need
to [create a Webhook](https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook)
, and set following environment variable on your pipeline:
- `TEAMS_WEBHOOK`
After this, you can add following section to your `.goreleaser.yml` config:
```yaml
# .goreleaser.yml
announce:
teams:
# Whether its enabled or not.
# Defaults to false.
enabled: true
# Title template to use while publishing.
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out!`
title_template: 'GoReleaser {{ .Tag }} was just released!'
# Message template to use while publishing.
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .GitURL }}/releases/tag/{{ .Tag }}`
message_template: 'Awesome project {{.Tag}} is out!'
# Color code of the message. You have to use hexadecimal.
# Defaults to `#2D313E` - the grey-ish from goreleaser
color: ''
# URL to an image to use as the icon for the message.
# Defaults to `https://goreleaser.com/static/avatar.png`
icon_url: ''
```
!!! tip
Learn more about the [name template engine](/customization/templates/).

View File

@ -0,0 +1,27 @@
# Twitter
For it to work, you'll need to [create a new Twitter app](https://developer.twitter.com/en/portal/apps/new), and set
some environment variables on your pipeline:
- `TWITTER_CONSUMER_KEY`
- `TWITTER_CONSUMER_SECRET`
- `TWITTER_ACCESS_TOKEN`
- `TWITTER_ACCESS_TOKEN_SECRET`
Then, you can add something like the following to your `.goreleaser.yml` config:
```yaml
# .goreleaser.yml
announce:
twitter:
# Whether its enabled or not.
# Defaults to false.
enabled: true
# Message template to use while publishing.
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .GitURL }}/releases/tag/{{ .Tag }}`
message_template: 'Awesome project {{.Tag}} is out!'
```
!!! tip
Learn more about the [name template engine](/customization/templates/).

View File

@ -2,8 +2,7 @@
title: Artifactory
---
Since [v0.38.0](https://github.com/goreleaser/goreleaser/releases/tag/v0.38.0),
GoReleaser supports building and pushing artifacts into Artifactory.
Publish your artifacts to an Artifactory instance.
## How it works

View File

@ -1,5 +1,5 @@
---
title: Blobs
title: Blobs (s3, gcs, azblob)
---
The `blobs` allows you to upload artifacts to Amazon S3, Azure Blob and

View File

@ -1,5 +1,5 @@
---
title: Checksum
title: Checksums
---
GoReleaser generates a `project_1.0.0_checksums.txt` file and uploads it with the

View File

@ -1,9 +1,9 @@
---
title: Docker
title: Docker Images
---
Since [v0.31.0](https://github.com/goreleaser/goreleaser/releases/tag/v0.31.0),
GoReleaser supports building and pushing Docker images.
GoReleaser can build and push Docker images.
Let's see how it works.
## How it works

View File

@ -1,12 +1,10 @@
---
title: Docker Manifest
title: Docker Manifests
---
Since [v0.148.0](https://github.com/goreleaser/goreleaser/releases/tag/v0.148.0),
GoReleaser supports building and pushing Docker multi-platform images through
the `docker manifest` tool.
GoReleaser can also create and push Docker multi-platform images using the `docker manifest` tool.
For it to work, it [has to be enabled in the client configurations](https://github.com/docker/cli/blob/master/experimental/README.md).
For it to work, it needs to be enabled in the [client's configuration](https://github.com/docker/cli/blob/master/experimental/README.md).
Please make sure `docker manifest` works before opening issues.

View File

@ -1,12 +1,12 @@
---
title: Docker Image Signing
title: Signing Docker Images and Manifests
---
Signing Docker Images and Manifests is also possible with GoReleaser.
This pipe was designed based on the common [sign](/customization/sign/) pipe having [cosign](https://github.com/sigstore/cosign) in mind.
!!! info
Note that this pipe will run only at the end of the GoReleaser execution, as cosign will change the image in the registry.
Note that this pipe will run only at the end of the GoReleaser execution (in its publish phase), as cosign will change the image in the registry.
To customize the signing pipeline you can use the following options:

View File

@ -1,5 +1,5 @@
---
title: Fury.io
title: Fury.io (apt and rpm repositories)
---
!!! success "GoReleaser Pro"

View File

@ -1,5 +1,5 @@
---
title: Homebrew
title: Homebrew Taps
---
After releasing to GitHub or GitLab, GoReleaser can generate and publish

View File

@ -1,6 +1,7 @@
# Customization
GoReleaser provides multiple customizations via the `.goreleaser.yml` file.
GoReleaser can be customized by tweaking a `.goreleaser.yml` file.
You can generate it by running `goreleaser init` or start from scratch.
The defaults are sensible and fit for most projects.
You can generate an example config by running [`goreleaser init`](/cmd/goreleaser_init/) or start from scratch.
You can also check if your config is valid by running [`goreleaser check`](/cmd/goreleaser_check/), which will tell you if are using deprecated or invalid options.

View File

@ -1,5 +1,5 @@
---
title: Milestone
title: Closing Milestones
---
GoReleaser can close repository milestones after successfully

View File

@ -1,5 +1,5 @@
---
title: NFPM
title: Linux packages (via nFPM)
---
GoReleaser can be wired to [nfpm](https://github.com/goreleaser/nfpm) to

View File

@ -1,5 +1,5 @@
---
title: Scoop
title: Scoop Manifests
---
After releasing to GitHub or GitLab, GoReleaser can generate and publish a

View File

@ -1,5 +1,5 @@
---
title: Signing
title: Signing checksums and artifacts
---
Signing ensures that the artifacts have been generated by yourself and your

View File

@ -1,5 +1,5 @@
---
title: Snapcraft
title: Snapcraft Packages (snaps)
---
GoReleaser can also generate `snap` packages.

View File

@ -6,6 +6,7 @@ IgnoreURLs:
- https://twitter.com/goreleaser
- support.discord.com
- microsoft.com
- https://github.com/goreleaser/goreleaser/edit/
IgnoreDirs:
- overrides
IgnoreDirectoryMissingTrailingSlash: true

View File

@ -69,36 +69,48 @@ nav:
- ci/travis.md
- Customization:
- About: customization/index.md
- customization/announce.md
- customization/archive.md
- customization/artifactory.md
- customization/blob.md
- customization/build.md
- customization/checksum.md
- customization/dist.md
- customization/docker.md
- customization/docker_manifest.md
- customization/docker_sign.md
- customization/env.md
- customization/fury.md
- customization/gomod.md
- customization/homebrew.md
- customization/hooks.md
- customization/includes.md
- customization/milestone.md
- customization/monorepo.md
- customization/nfpm.md
- customization/nightly.md
- customization/project.md
- customization/publishers.md
- customization/release.md
- customization/scoop.md
- customization/sign.md
- customization/snapcraft.md
- customization/snapshots.md
- customization/source.md
- customization/templates.md
- customization/upload.md
- Basics:
- customization/includes.md
- customization/templates.md
- customization/env.md
- customization/hooks.md
- customization/dist.md
- customization/project.md
- Build:
- customization/build.md
- customization/gomod.md
- customization/monorepo.md
- Packaging and Archiving:
- customization/archive.md
- customization/nfpm.md
- customization/checksum.md
- customization/snapcraft.md
- customization/docker.md
- customization/docker_manifest.md
- Signing:
- Checksums and artifacts: customization/sign.md
- Docker Images and Manifests: customization/docker_sign.md
- Publish:
- customization/blob.md
- customization/fury.md
- customization/homebrew.md
- customization/scoop.md
- customization/release.md
- customization/artifactory.md
- customization/publishers.md
- customization/upload.md
- customization/source.md
- customization/milestone.md
- customization/snapshots.md
- customization/nightly.md
- Announce:
- About: customization/announce/index.md
- customization/announce/discord.md
- customization/announce/reddit.md
- customization/announce/slack.md
- customization/announce/smtp.md
- customization/announce/teams.md
- customization/announce/twitter.md
- Command Line Usage:
- goreleaser: cmd/goreleaser.md
- goreleaser init: cmd/goreleaser_init.md