-
Notifications
You must be signed in to change notification settings - Fork 11
56 lines (52 loc) · 1.79 KB
/
release.yml
File metadata and controls
56 lines (52 loc) · 1.79 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
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 }}