Release #1
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
permissions: | |
contents: write | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Validate Tag Format | |
run: | | |
echo "Validating tag $GITHUB_REF..." | |
if [[ ! "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+(\.[0-9]+)*)?$ ]]; then | |
echo "Invalid tag format: $GITHUB_REF" | |
echo "Expected format: vMAJOR.MINOR.PATCH (e.g. v1.0.0)" | |
echo "(Pre-release tags are also valid, e.g. v1.0.0-alpha)" | |
exit 1 | |
fi | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ">=1.22.0" | |
- uses: goreleaser/goreleaser-action@v5 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |