-
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (88 loc) · 2.35 KB
/
release.yml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Release
on:
push:
branches:
- "main"
- "develop"
tags:
- "v*"
paths-ignore:
- ".github/ISSUE_TEMPLATE/**"
- ".github/images/**"
- "**.md"
pull_request:
paths-ignore:
- ".github/ISSUE_TEMPLATE/**"
- ".github/images/**"
- "**.md"
env:
REGISTRY: ghcr.io
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}
GO_VERSION: "1.23.4"
permissions:
contents: write
packages: write
jobs:
test:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Run Tests
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
run: make test-race
goreleaserbuild:
name: Build distribution binaries
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Run GoReleaser build
if: github.event_name == 'pull_request'
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean --skip=validate,publish --parallelism 5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILDER: ${{ github.actor }}@github-actions
- name: Run GoReleaser build and publish tags
if: startsWith(github.ref, 'refs/tags/')
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILDER: ${{ github.actor }}@github-actions
- name: Upload assets
uses: actions/upload-artifact@v4
with:
name: mkbrr
path: |
dist/*.tar.gz
dist/*.zip
dist/*.deb
dist/*.rpm