Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 61 additions & 49 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: goreleaser
on:
pull_request:
paths:
- .github/workflows/goreleaser.yml
- .goreleaser.yaml
- .github/workflows/goreleaser.yml
- .goreleaser.yaml
push:
tags:
- 'v*'
- "v*"

permissions:
contents: write
Expand All @@ -16,56 +16,68 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
with:
fetch-depth: 0
- name: Free disk space
uses: thiagokokada/free-disk-space@9a03d73a373bab1e204b8815f5c7752392482762
with:
# All of these do save some disk space, but are also somewhat slow to delete.
# So we keep them to just speed up the workflow overall.
android: false
aws-cli: false
debug: false
docker-images: false
google-cloud-sdk: false
heroku: false
llvm: false
opt: false
powershell: false
python: false
ruby: false
rust: false
tool-cache: false
usrlocal: false
usrmisc: false
varcache: false

- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
with:
go-version: v1.23.10
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
with:
fetch-depth: 0

- name: Download go modules
run: |
echo "Downloading modules for go.mod"
go mod download
for gomod in **/go.mod; do
echo "Downloading modules for $gomod"
cd $(dirname $gomod)
go mod download
cd -
done
- name: Setup Go
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
with:
go-version: v1.23.10

- name: Delete non-semver tags
run: 'git tag -d $(git tag -l | grep -v "^v")'
- name: Delete non-semver tags
run: 'git tag -d $(git tag -l | grep -v "^v")'

- name: Set LDFLAGS
run: echo LDFLAGS="$(make ldflags)" >> $GITHUB_ENV
- name: Set LDFLAGS
run: echo LDFLAGS="$(make ldflags)" >> $GITHUB_ENV

- name: Run GoReleaser on tag
if: github.event_name != 'pull_request'
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # tag=v6.3.0
with:
distribution: goreleaser
version: latest
args: release --timeout 60m --parallelism 1 --fail-fast
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KREW_GITHUB_TOKEN: ${{ secrets.KREW_GITHUB_TOKEN }}
- name: Run GoReleaser on tag
if: github.event_name != 'pull_request'
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # tag=v6.3.0
with:
distribution: goreleaser
version: "~> v2"
args: release --timeout 60m
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KREW_GITHUB_TOKEN: ${{ secrets.KREW_GITHUB_TOKEN }}

- name: Run GoReleaser on pull request
if: github.event_name == 'pull_request'
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # tag=v6.3.0
with:
distribution: goreleaser
version: latest
args: release --timeout 60m --snapshot --parallelism 1 --fail-fast
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KREW_GITHUB_TOKEN: ${{ secrets.KREW_GITHUB_TOKEN }}
- name: Run GoReleaser on pull request
if: github.event_name == 'pull_request'
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # tag=v6.3.0
with:
distribution: goreleaser
version: "~> v2"
args: release --timeout 60m --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KREW_GITHUB_TOKEN: ${{ secrets.KREW_GITHUB_TOKEN }}

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag=v4.6.2
if: ${{ always() }}
with:
name: binaries
path: dist/*.tar.gz
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag=v4.6.2
if: ${{ always() }}
with:
name: binaries
path: dist/*.tar.gz