Skip to content

ci/cd: bump go releaser version #16

ci/cd: bump go releaser version

ci/cd: bump go releaser version #16

Workflow file for this run

name: Release CLI
on:
push:
tags:
- "cli/v*"
jobs:
release:
runs-on: proxmox-lxc
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Set version
id: version
run: |
VERSION=${GITHUB_REF_NAME#cli/}
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Extract changelog
id: changelog
run: |
VERSION=${GITHUB_REF_NAME#cli/}
CHANGES=$(awk -v ver="$VERSION" '
$0 ~ "^## \\[" ver "\\]" {found=1; next}
$0 ~ "^## \\[" {found=0}
found {print}
' cli/CHANGELOG.md)
if [ -z "$CHANGES" ]; then
CHANGES="No changelog entry was found for this release."
fi
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- uses: goreleaser/goreleaser-action@v5
with:
version: "~> v2"
args: release --clean --config cli/.goreleaser.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_NOTES: ${{ steps.changelog.outputs.changelog }}
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.version }}