Skip to content

chore(release): release v2.5.0 #43

chore(release): release v2.5.0

chore(release): release v2.5.0 #43

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g. v2.4.3). Must not already exist. The tag will be created at the current HEAD of the default branch.'
required: true
push:
tags:
- 'v*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
-
name: Create and push tag (workflow_dispatch only)
if: github.event_name == 'workflow_dispatch'
run: |
TAG="${{ github.event.inputs.tag }}"
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9] ]]; then
echo "Error: tag '$TAG' does not match expected format (e.g. v2.4.3)"
exit 1
fi
if git ls-remote --exit-code --tags origin "refs/tags/$TAG" > /dev/null 2>&1; then
echo "Error: tag '$TAG' already exists on the remote"
exit 1
fi
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "$TAG"
git push origin "$TAG"
-
name: Set up Go
uses: actions/setup-go@v6
with:
go-version: stable
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUBRELEASETOKEN }}