-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (57 loc) · 1.68 KB
/
release.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
name: Release
on:
push:
branches:
- main
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.1'
- name: test
run: go test -v ./...
release:
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
discussions: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.22.1'
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Build Binaries
run: |
mkdir -p release
GOOS=linux GOARCH=amd64 go build -o release/evm-exporter-linux-amd64 ./cmd/exporter
GOOS=darwin GOARCH=amd64 go build -o release/evm-exporter-darwin-amd64 ./cmd/exporter
GOOS=darwin GOARCH=arm64 go build -o release/evm-exporter-darwin-arm64 ./cmd/exporter
GOOS=windows GOARCH=amd64 go build -o release/evm-exporter-windows-amd64.exe ./cmd/exporter
- name: Install semantic-release
run: npm install @semantic-release/git @semantic-release/changelog @semantic-release/exec conventional-changelog-conventionalcommits
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release -e ./.github/release.config.js