Skip to content

Add goreleaser and CLI publish workflow #8

Add goreleaser and CLI publish workflow

Add goreleaser and CLI publish workflow #8

Workflow file for this run

name: Publish Release CLI
on:
push:
tags:
- cli/v*
release:
types:
- published
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
- name: Set VERSION
run: |
TAG="${{ github.event.inputs.version || github.ref_name }}"
# Get rid of the tag since the cli/ prefix confuses goreleaser.
git tag -d $TAG
echo VERSION=${TAG#cli/v} >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean --snapshot --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload assets
uses: actions/upload-artifact@v4
with:
name: release
path: dist/*