-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (45 loc) · 1.39 KB
/
Copy pathgoreleaser.yml
File metadata and controls
45 lines (45 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: goreleaser
on:
push:
tags:
- "*"
# Rebuild an existing tag with the current Go toolchain (e.g. CVE fix in Go).
workflow_dispatch:
inputs:
tag:
description: "Tag to rebuild and re-release (e.g. v0.5.0); empty = latest tag"
required: false
default: ""
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || '' }}
- name: Check out latest tag
if: github.event_name == 'workflow_dispatch' && inputs.tag == ''
run: git checkout "$(git tag --sort=-v:refname | head -n1)"
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
check-latest: true
# setup-go exports GOTOOLCHAIN=local via GITHUB_ENV; a later write wins.
- name: Allow Go toolchain downloads
run: echo "GOTOOLCHAIN=auto" >> "$GITHUB_ENV"
- name: Install Task
uses: go-task/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: latest
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}