* fix: Update GitHub actions with new YAML syntax * Update www/content/actions.md Co-Authored-By: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> * Update www/content/actions.md Co-Authored-By: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
1.6 KiB
title | menu | weight |
---|---|---|
GitHub Actions | true | 141 |
GoReleaser can also be used within GitHub Actions.
For detailed intructions please follow GitHub Actions workflow syntax.
You can create a workflow for pushing your releases by putting YAML
configuration to .github/workflows/release.yml
.
Example workflow:
on:
push:
tags:
- 'v*'
name: GoReleaser
jobs:
release:
name: Release
runs-on: ubuntu-latest
#needs: [ test ]
steps:
- name: Check out code
uses: actions/checkout@master
- name: goreleaser
uses: docker://goreleaser/goreleaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: release
if: success()
This supports everything already supported by GoReleaser's Docker image. Check the install section for more details.
If you need to push the homebrew tap to another repository, you'll need a
custom github token, for that, add a GORELEASER_GITHUB_TOKEN
secret and
remove the default GITHUB_TOKEN
. The default, auto-generated token only
has access to current the repo.
What doesn't work
Projects that depend on $GOPATH
. GitHub Actions override the WORKDIR
instruction and it seems like we can't override it.
In the future releases we may hack something together to work around this, but, for now, only projects using Go modules are supported.