-
Notifications
You must be signed in to change notification settings - Fork 3
102 lines (89 loc) · 2.36 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
100
101
102
name: build
on:
push:
branches:
- "main"
tags:
- "v*"
pull_request:
permissions:
contents: write
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# 1.20 is the last version to support Windows < 10, Server < 2016, and MacOS < 1.15.
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20.7"
cache: true
- name: Test
run: go test -v ./...
goreleaserbuild:
name: Build Go binaries
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# 1.20 is the last version to support Windows < 10, Server < 2016, and MacOS < 1.15.
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20.7"
cache: true
- name: Run GoReleaser build
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean --skip-validate --skip-publish --parallelism 99
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload assets
uses: actions/upload-artifact@v3
with:
name: shinkrodb
path: |
dist/*.tar.gz
dist/*.zip
goreleaser:
name: Build and publish binaries
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# 1.20 is the last version to support Windows < 10, Server < 2016, and MacOS < 1.15.
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20.7"
cache: true
- name: Run GoReleaser build and publish tags
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload assets
uses: actions/upload-artifact@v3
with:
name: shinkrodb
path: |
dist/*.tar.gz
dist/*.zip