-
Notifications
You must be signed in to change notification settings - Fork 5
95 lines (90 loc) · 2.53 KB
/
main.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
name: Main
on: [push]
permissions:
contents: write
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- uses: actions/checkout@v4
with:
lfs: true
- uses: golangci/golangci-lint-action@v6
with:
version: latest
test:
name: go test
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- run: go test ./...
build:
runs-on: ubuntu-latest
name: Build
steps:
- name: Detect snapshot
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: echo "flags=--snapshot" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean ${{ env.flags }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# This should have been a matrix, but building separate targets is a paid feature in `goreleaser`
- uses: actions/upload-artifact@v4
with:
name: darwin-x86_64
path: dist/warchaeology_Darwin_x86_64*.tar.gz
- uses: actions/upload-artifact@v4
with:
name: linux-x86_64
path: dist/warchaeology_Linux_x86_64.tar.gz
- uses: actions/upload-artifact@v4
with:
name: linux-i386
path: dist/warchaeology_Linux_i386.tar.gz
- uses: actions/upload-artifact@v4
with:
name: windows-x86_64
path: dist/warchaeology_Windows_x86_64.zip
- uses: actions/upload-artifact@v4
with:
name: windows-i386
path: dist/warchaeology_Windows_i386.zip
- uses: actions/upload-artifact@v4
with:
name: deb-amd64
path: dist/warchaeology_*amd64.deb
- uses: actions/upload-artifact@v4
with:
name: deb-i386
path: dist/warchaeology_*i386.deb
- uses: actions/upload-artifact@v4
with:
name: rpm-x86_64
path: dist/warchaeology-*x86_64.rpm
- uses: actions/upload-artifact@v4
with:
name: rpm-i386
path: dist/warchaeology-*i386.rpm