- v2.7.6 #20
Workflow file for this run
This file contains hidden or 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*" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Unshallow repo | |
run: git fetch --prune --unshallow | |
- name: Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.24.5" | |
- name: Go Dependency | |
run: go mod tidy | |
- name: Env | |
id: vars | |
run: | | |
printf "Using go at: $(which go)\n" | |
printf "Go version: $(go version)\n" | |
printf "\n\nGo environment:\n\n" | |
go env | |
printf "\n\nSystem environment:\n\n" | |
env | |
echo "name=version_tag::${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | |
echo "name=short_sha::$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
echo "name=go_cache::$(go env GOCACHE)" >> $GITHUB_OUTPUT | |
# Parse semver | |
TAG=${GITHUB_REF/refs\/tags\//} | |
SEMVER_RE='[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z\.-]*\)' | |
TAG_MAJOR=`echo ${TAG#v} | sed -e "s#$SEMVER_RE#\1#"` | |
TAG_MINOR=`echo ${TAG#v} | sed -e "s#$SEMVER_RE#\2#"` | |
TAG_PATCH=`echo ${TAG#v} | sed -e "s#$SEMVER_RE#\3#"` | |
TAG_SPECIAL=`echo ${TAG#v} | sed -e "s#$SEMVER_RE#\4#"` | |
echo "name=tag_major::${TAG_MAJOR}" >> $GITHUB_OUTPUT | |
echo "name=tag_minor::${TAG_MINOR}" >> $GITHUB_OUTPUT | |
echo "name=tag_patch::${TAG_PATCH}" >> $GITHUB_OUTPUT | |
echo "name=tag_special::${TAG_SPECIAL}" >> $GITHUB_OUTPUT | |
# GoReleaser will take care of publishing those artifacts into the release | |
- name: GoReleaser | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAG: ${{ steps.vars.outputs.version_tag }} |