Skip to content

Update goreleaser for v2-alpha #9

Update goreleaser for v2-alpha

Update goreleaser for v2-alpha #9

Workflow file for this run

name: Release
on:
push:
tags:
- "v*" # Match all version tags (v1.0.0, v2.0.0-beta.1, etc.)
jobs:
main:
name: Main
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for changelog generation
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.19"
- name: Get dependencies
run: make deps
- name: Build
run: make
- name: Test
run: go test
- name: Determine GoReleaser config
id: config
run: |
if [[ "${{ github.ref }}" =~ ^refs/tags/v2\.0\.0-alpha ]]; then
echo "config_file=.goreleaser.v2-alpha.yml" >> $GITHUB_OUTPUT
echo "release_type=alpha" >> $GITHUB_OUTPUT
else
echo "config_file=.goreleaser.yaml" >> $GITHUB_OUTPUT
echo "release_type=stable" >> $GITHUB_OUTPUT
fi
- name: Run GoReleaser (Alpha)
if: steps.config.outputs.release_type == 'alpha'
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --config=${{ steps.config.outputs.config_file }} --clean
env:
# set github personal access token in order to generate brew formula to external repository
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
- name: Run GoReleaser (Stable)
if: steps.config.outputs.release_type == 'stable'
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --config=${{ steps.config.outputs.config_file }} --clean
env:
# set github personal access token in order to generate brew formula to external repository
GITHUB_TOKEN: ${{ secrets.GH_PAT }}