-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (75 loc) · 2.07 KB
/
ci.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
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
name: CI
on: push
permissions:
contents: write
env:
ANVIL_TAG: nightly-2cdbfaca634b284084d0f86357623aef7a0d2ce3
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Clang
run: sudo apt-get update && sudo apt-get install -y clang
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: ${{ env.ANVIL_TAG }}
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
args: --timeout=5m --out-format=colored-line-number
version: latest
- name: Check generate
run: make check-gen
- name: Build
run: make build
- name: Run node v2 database
run: make up-db-raw
- name: Test
run: make test
release:
name: Release
runs-on: ubuntu-latest
needs: [build]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Trim CHANGELOG.md
run: sed -e '0,/^##[^#]/d' -e '/^##[^#]/,$d' -i CHANGELOG.md
- name: Publish Github release
uses: softprops/action-gh-release@v2
with:
prerelease: true
body_path: CHANGELOG.md
releases-matrix:
name: Build binaries for release
runs-on: ubuntu-latest
needs: [release]
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64, arm64, riscv64]
exclude:
- goarch: arm64
goos: windows
- goarch: riscv64
goos: windows
- goarch: riscv64
goos: darwin
steps:
- uses: actions/checkout@v4
- uses: wangyoucao577/go-release-action@v1
with:
overwrite: true
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
extra_files: CHANGELOG.md LICENSE README.md