Skip to content

feat: Clean up GHA

feat: Clean up GHA #3

Workflow file for this run

on:
push:
tags:
- 'v*'
#tag-ignore:
# - 'v*'
workflow_dispatch: {}
env:
GOTELEMETRY: off
CGO_ENABLED: 0
name: Release
jobs:
release:
if: startsWith(github.ref, 'refs/tags/v')
name: Release
runs-on: ubuntu-latest
#needs: [ test ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # disable shallow clone - get all
#- name: Unshallow
# run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
id: go
- name: Generate build tag
run: |
VERSION=$(git describe --tags --always --dirty --match=v* 2> /dev/null || echo v0)
echo "VERSION=$VERSION" >> $GITHUB_ENV
shell: /bin/bash -e {0}
- name: Print build tag
run: echo "${VERSION}"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2' # latest
args: release --clean
workdir: .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ env.VERSION }}