47 lines
1017 B
YAML
47 lines
1017 B
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "Tag to (re)release (e.g. v0.1.0)"
|
|
required: true
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
goreleaser:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Stash GoReleaser config
|
|
run: cp .goreleaser.yaml /tmp/.goreleaser.yaml
|
|
|
|
- name: Checkout release tag
|
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
run: git checkout ${{ inputs.tag }}
|
|
|
|
- name: GoReleaser
|
|
uses: goreleaser/goreleaser-action@v6
|
|
with:
|
|
distribution: goreleaser
|
|
version: latest
|
|
args: release --clean --config /tmp/.goreleaser.yaml
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|