-
Notifications
You must be signed in to change notification settings - Fork 30
82 lines (80 loc) · 2.74 KB
/
go.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
name: Go
on:
push:
branches: [ dev, main ]
pull_request:
branches: [ dev, main ]
release:
types: [prereleased]
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
GOOS: [linux, windows, darwin, android]
GOARCH: [386, amd64, arm, arm64]
exclude:
- { GOOS: darwin, GOARCH: arm }
- { GOOS: darwin, GOARCH: arm64 }
- { GOOS: darwin, GOARCH: 386 }
- { GOOS: windows, GOARCH: arm64 }
- { GOOS: windows, GOARCH: arm64 }
- { GOOS: android, GOARCH: 386 }
- { GOOS: android, GOARCH: amd64 }
- { GOOS: android, GOARCH: arm }
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Build dedicated
env:
GOOS: ${{ matrix.GOOS }}
GOARCH: ${{ matrix.GOARCH }}
CGO_ENABLED: 0
run: go build -o gun-dedicated-${{ matrix.GOOS }}-${{ matrix.GOARCH }} github.com/Qv2ray/gun/cmd
- name: Upload dedicated assets
uses: actions/[email protected]
with:
name: gun-dedicated-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
path: gun-dedicated-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
- name: Upload dedicated release
uses: svenstaro/upload-release-action@v1-release
if: github.event_name == 'release'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: gun-dedicated-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
asset_name: gun-dedicated-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
tag: ${{ github.ref }}
overwrite: true
- name: Build SIP003 plugin
env:
GOOS: ${{ matrix.GOOS }}
GOARCH: ${{ matrix.GOARCH }}
CGO_ENABLED: 0
run: go build -o gun-sip003-${{ matrix.GOOS }}-${{ matrix.GOARCH }} github.com/Qv2ray/gun/cmd/sip003
- name: Upload SIP003 plugin assets
uses: actions/[email protected]
with:
name: gun-sip003-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
path: gun-sip003-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
- name: Upload SIP003 plugin release
uses: svenstaro/upload-release-action@v1-release
if: github.event_name == 'release'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: gun-sip003-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
asset_name: gun-sip003-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
tag: ${{ github.ref }}
overwrite: true