chore(deps): bump goreleaser/goreleaser-action from 6.0.0 to 6.1.0 #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GoReleaser | |
on: | |
push: | |
branches: [ main ] | |
tags: [ 'v*.*.*' ] | |
pull_request: | |
branches: [ main ] | |
permissions: | |
contents: write | |
jobs: | |
release: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # It is required for GoReleaser to work properly. | |
# This is needed if you use fields like TagBody, TagSubject or | |
# TagContents in your templates. | |
- name: Fetch all tags | |
run: git fetch --force --tags | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
# Getting go version from the go.mod file | |
go-version-file: 'go.mod' | |
- run: go version | |
# Sanity check before publishing | |
- name: Test all | |
run: go test -v ./... | |
- name: Set goreleaser snapshot env | |
run: if [[ $GITHUB_REF != refs/tags/v* ]]; then echo "goreleaser_snapshot=--snapshot"; fi >> $GITHUB_ENV | |
- name: Read variables | |
run: | | |
echo "goreleaser_snapshot=${{ env.goreleaser_snapshot }}" | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # V6.1.0 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean ${{ env.goreleaser_snapshot }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |