Skip to content

Using goreleaser to handle the release process #8

Using goreleaser to handle the release process

Using goreleaser to handle the release process #8

Workflow file for this run

name: Release
on:
push:
tags:
- v*
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
id: go
- name: Cache Go Modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: go test -v ./...
- run: ./test.sh
- name: Get the version
id: get_version
run: |
VERSION=${GITHUB_REF/refs\/tags\//}
if ${{github.event_name == 'workflow_dispatch'}}; then
VERSION=$(git describe --abbrev=0 --tags)
fi
echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.get_version.outputs.VERSION }}
with:
version: '~> v1'
args: release --clean