-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (75 loc) · 2.15 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
---
name: Upload Release Asset
on:
workflow_dispatch:
release:
types: [published]
jobs:
codecov:
runs-on: ubuntu-latest
name: Codecov
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: "go mod tidy"
run: |
go mod tidy
- name: "go test"
run: |
go test -v -failfast -timeout=300s -count=2 -coverprofile=coverage.txt ./...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
upload_linux:
name: "Linux Binaries"
needs: codecov
strategy:
matrix:
os: [linux]
arch: [amd64,arm64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: "go mod tidy"
run: |
go mod tidy
- name: "go build"
run: |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build ./cmd/sbsmux
tar cJvf ./sbsmux.${{ github.ref_name }}.${{ matrix.os }}.${{ matrix.arch }}.tar.xz ./sbsmux
rm -v ./sbsmux
- name: Upload binaries to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} ./sbsmux.${{ github.ref_name }}.${{ matrix.os }}.${{ matrix.arch }}.tar.xz
upload_windows:
name: "Windows Binaries"
needs: codecov
strategy:
matrix:
os: [windows]
arch: [amd64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: "go mod tidy"
run: |
go mod tidy
- name: "go build"
run: |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build ./cmd/sbsmux
zip -vD ./sbsmux.${{ github.ref_name }}.${{ matrix.os }}.${{ matrix.arch }}.zip ./sbsmux.exe
rm -v ./sbsmux.exe
- name: Upload binaries to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} ./sbsmux.${{ github.ref_name }}.${{ matrix.os }}.${{ matrix.arch }}.zip