* ci(deps): bump the actions group with 5 updates Bumps the actions group with 5 updates: | Package | From | To | | --- | --- | --- | | [actions/setup-go](https://github.com/actions/setup-go) | `6.3.0` | `6.4.0` | | [crazy-max/ghaction-import-gpg](https://github.com/crazy-max/ghaction-import-gpg) | `6.3.0` | `7.0.0` | | [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3.12.0` | `4.0.0` | | [docker/bake-action](https://github.com/docker/bake-action) | `6.10.0` | `7.0.0` | | [codecov/codecov-action](https://github.com/codecov/codecov-action) | `5.5.2` | `6.0.0` | Updates `actions/setup-go` from 6.3.0 to 6.4.0 - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/4b73464bb391d4059bd26b0524d20df3927bd417...4a3601121dd01d1626a1e23e37211e3254c1c06c) Updates `crazy-max/ghaction-import-gpg` from 6.3.0 to 7.0.0 - [Release notes](https://github.com/crazy-max/ghaction-import-gpg/releases) - [Commits](https://github.com/crazy-max/ghaction-import-gpg/compare/e89d40939c28e39f97cf32126055eeae86ba74ec...2dc316deee8e90f13e1a351ab510b4d5bc0c82cd) Updates `docker/setup-buildx-action` from 3.12.0 to 4.0.0 - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/8d2750c68a42422c14e847fe6c8ac0403b4cbd6f...4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd) Updates `docker/bake-action` from 6.10.0 to 7.0.0 - [Release notes](https://github.com/docker/bake-action/releases) - [Commits](https://github.com/docker/bake-action/compare/5be5f02ff8819ecd3092ea6b2e6261c31774f2b4...82490499d2e5613fcead7e128237ef0b0ea210f7) Updates `codecov/codecov-action` from 5.5.2 to 6.0.0 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/671740ac38dd9b0130fbe1cec585b89eea48d3de...57e3a136b779b570ffcdbf80b3bdc90e7fab3de2) --- updated-dependencies: - dependency-name: actions/setup-go dependency-version: 6.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: crazy-max/ghaction-import-gpg dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: docker/setup-buildx-action dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: docker/bake-action dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: codecov/codecov-action dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> * ci: switch to matrix subaction for bake --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
GoReleaser Action
GitHub Action for GoReleaser
Usage
GoReleaser Action runs goreleaser, please follow its docs for more information about how to customize what GoReleaser does.
Workflow
name: goreleaser
on:
pull_request:
push:
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v6
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
# 'latest', 'nightly', or a semver
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
Important
: note the
fetch-depth: 0input inCheckoutstep. It is required for the changelog to work correctly.
Run on new tag
If you want to run GoReleaser only on new tag, you can use this event:
on:
push:
tags:
- '*'
Or with a condition on GoReleaser step:
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
if: startsWith(github.ref, 'refs/tags/')
with:
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
For detailed instructions please follow GitHub Actions workflow syntax.
Signing
If signing is enabled in your GoReleaser configuration, you can use the Import GPG GitHub Action along with this one:
-
name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
And reference the fingerprint in your signing configuration using the GPG_FINGERPRINT environment variable:
signs:
- artifacts: checksum
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]
Upload artifacts
For some events like pull request or schedule you might want to store the artifacts somewhere for testing purposes. You can do that with the actions/upload-artifact action:
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
version: '~> v2'
args: release --clean
workdir: myfolder
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Upload assets
uses: actions/upload-artifact@v6
with:
name: myapp
path: myfolder/dist/*
Install Only
steps:
-
name: Install GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
install-only: true
-
name: Show GoReleaser version
run: goreleaser -v
Customizing
inputs
Following inputs can be used as step.with keys
| Name | Type | Default | Description |
|---|---|---|---|
distribution |
String | goreleaser |
GoReleaser distribution, either goreleaser or goreleaser-pro |
version¹ |
String | ~> v2 |
GoReleaser version |
args |
String | Arguments to pass to GoReleaser | |
workdir |
String | . |
Working directory (below repository root) |
install-only |
Bool | false |
Just install GoReleaser |
¹ Can be a fixed version like
v0.117.0or a max satisfying semver one like~> 0.132. In this case this will returnv0.132.1.
outputs
Following outputs are available
| Name | Type | Description |
|---|---|---|
artifacts |
JSON | Build result artifacts |
metadata |
JSON | Build result metadata |
environment variables
Following environment variables can be used as step.env keys
| Name | Description |
|---|---|
GITHUB_TOKEN |
GITHUB_TOKEN as provided by secrets and requires contents:write |
GORELEASER_KEY |
Your GoReleaser Pro License Key, in case you are using the goreleaser-pro distribution |
Limitation
GITHUB_TOKEN permissions are limited to the repository
that contains your workflow.
If you need to push the homebrew tap to another repository, you must therefore create a custom Personal Access Token
with repo permissions and add it as a secret in the repository. If you create a
secret named GH_PAT, the step will look like this:
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
Migrating from v3
If you need the auto-snapshot feature, take a look at this example repository: it's a minimal working example with all you need.
Development
# format code and build javascript artifacts
docker buildx bake pre-checkin
# validate all code has correctly formatted and built
docker buildx bake validate
# run tests
docker buildx bake test
License
MIT. See LICENSE for more details.
