1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-13 13:48:40 +02:00

docs: Update GitHub Actions page (#1486)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-05-07 14:13:46 +02:00 committed by GitHub
parent 8f8063c495
commit cafc9997b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,9 +4,11 @@ menu: true
weight: 141
---
GoReleaser can also be used within our official [GoReleaser Action][goreleaser-action] through [GitHub Actions][actions].
GoReleaser can also be used within our official [GoReleaser Action][goreleaser-action]
through [GitHub Actions][actions].
You can create a workflow for pushing your releases by putting YAML configuration to `.github/workflows/release.yml`.
You can create a workflow for pushing your releases by putting YAML configuration to
`.github/workflows/release.yml`.
Below is a simple snippet to use this action in your workflow:
@ -29,9 +31,9 @@ jobs:
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: 1.14.x
go-version: 1.14
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
@ -74,7 +76,7 @@ Or with a condition on GoReleaser step:
## Customizing
### Inputs
### inputs
Following inputs can be used as `step.with` keys
@ -85,7 +87,35 @@ Following inputs can be used as `step.with` keys
| `key` | String | | Private key to import |
| `workdir` | String | `.` | Working directory (below repository root) |
### Signing
### environment variables
Following environment variables can be used as `step.env` keys
| Name | Description |
|----------------|-------------------------------------------------------|
| `GITHUB_TOKEN` | [GITHUB_TOKEN][github-token] as provided by `secrets` |
## Limitation
`GITHUB_TOKEN` permissions [are limited to the repository][about-github-token] that contains your workflow.
If you need to push the homebrew tap to another repository, you must therefore create a custom
[Personal Access Token][pat] with `repo` permissions and [add it as a secret in the repository][secrets]. If you
create a secret named `GH_PAT`, the step will look like this:
```yaml
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
key: ${{ secrets.YOUR_PRIVATE_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
```
## Signing
If signing is enabled in your GoReleaser configuration, populate the
`key` input with your private key and reference the key in your signing
@ -103,3 +133,7 @@ command and a private key without a passphrase.
[goreleaser-action]: https://github.com/goreleaser/goreleaser-action
[actions]: https://github.com/features/actions
[syntax]: https://help.github.com/en/articles/workflow-syntax-for-github-actions#About-yaml-syntax-for-workflows
[github-token]: https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token
[about-github-token]: https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#about-the-github_token-secret
[pat]: https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
[secrets]: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets