-
Notifications
You must be signed in to change notification settings - Fork 14
57 lines (51 loc) · 1.41 KB
/
Copy pathrelease.yml
File metadata and controls
57 lines (51 loc) · 1.41 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
46
47
48
49
50
51
52
53
54
55
56
57
name: Ship Release
run-name: "Ship ${{ github.event.inputs.release_type }} Release"
on:
workflow_dispatch:
inputs:
release_type:
description: 'Type of version bump (major, minor, or patch)'
required: true
type: choice
default: 'minor'
options:
- major
- minor
- patch
jobs:
release:
name: Release Go Binary
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: stable
- name: Go Version
run: go version
- name: Create Tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go install github.com/caarlos0/svu/v3@latest
release_type=${{ github.event.inputs.release_type }}
release_type=${release_type:-patch}
tag=$(svu ${release_type})
echo "tag: $tag"
git tag "$tag"
git push --tags
- name: GoReleaser Release
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}