-
-
Notifications
You must be signed in to change notification settings - Fork 24
52 lines (50 loc) · 1.27 KB
/
ci-cd.yaml
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
on: [push, pull_request]
name: Test, Build and Publish
jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.20.x"
- name: Run tests
run: go test -race ./...
goreleaser:
name: Build and Publish
needs: tests
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20.x"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
check_brew:
name: Check Brew Tap
needs: goreleaser
runs-on: macos-latest
steps:
- name: Install gitmux with brew
run: |
brew tap arl/arl
brew install gitmux
gitmux -V
- name: Check installed gitmux version
run: |
[ v$(gitmux -V) == "$GITHUB_REF_NAME" ]