-
Notifications
You must be signed in to change notification settings - Fork 9
93 lines (76 loc) · 2 KB
/
ci.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
name: CI
on: [push]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
# do not enable cache here, because golangci-linter
# has its own internal cache with better performance
go-version: 1.22.x
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.59
- name: Run tests
run: make test
build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.22.x
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: build --snapshot --clean
workdir: .
- name: Upload assets
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: platformify
path: ./dist/*
retention-days: 14
build-upsun:
needs: test
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.22.x
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: build --config=.goreleaser.upsun.yaml --snapshot --clean
workdir: .
- name: Upload assets
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: upsunify
path: ./dist/*
retention-days: 7