Skip to content

Commit 427cadf

Browse files
committed
Try new GitHub action approach.
1 parent 9974baf commit 427cadf

File tree

1 file changed

+43
-109
lines changed

1 file changed

+43
-109
lines changed

.github/workflows/release.yml

+43-109
Original file line numberDiff line numberDiff line change
@@ -3,115 +3,49 @@
33
on: release
44
name: Build Release
55
jobs:
6-
release-linux-386:
7-
name: release linux/386
8-
runs-on: ubuntu-latest
9-
steps:
10-
- uses: actions/checkout@master
11-
- uses: actions/setup-go@v2
12-
with:
13-
go-version: '^1.16.1'
14-
- name: compile and release
15-
16-
env:
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18-
GOARCH: "386"
19-
GOOS: linux
20-
EXTRA_FILES: "LICENSE"
21-
GO111MODULE: on
22-
release-linux-amd64:
23-
name: release linux/amd64
24-
runs-on: ubuntu-latest
25-
steps:
26-
- uses: actions/checkout@master
27-
- uses: actions/setup-go@v2
28-
with:
29-
go-version: '^1.16.1'
30-
- name: compile and release
31-
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
GOARCH: amd64
35-
GOOS: linux
36-
EXTRA_FILES: "LICENSE"
37-
GO111MODULE: on
38-
release-linux-arm:
39-
name: release linux/386
40-
runs-on: ubuntu-latest
41-
steps:
42-
- uses: actions/checkout@master
43-
- uses: actions/setup-go@v2
44-
with:
45-
go-version: '^1.16.1'
46-
- name: compile and release
47-
48-
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
GOARCH: "arm"
51-
GOOS: linux
52-
EXTRA_FILES: "LICENSE"
53-
GO111MODULE: on
54-
release-linux-arm64:
55-
name: release linux/amd64
56-
runs-on: ubuntu-latest
57-
steps:
58-
- uses: actions/checkout@master
59-
- uses: actions/setup-go@v2
60-
with:
61-
go-version: '^1.16.1'
62-
- name: compile and release
63-
64-
env:
65-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66-
GOARCH: arm64
67-
GOOS: linux
68-
EXTRA_FILES: "LICENSE"
69-
GO111MODULE: on
70-
release-darwin-amd64:
71-
name: release darwin/amd64
72-
runs-on: ubuntu-latest
73-
steps:
74-
- uses: actions/checkout@master
75-
- uses: actions/setup-go@v2
76-
with:
77-
go-version: '^1.16.1'
78-
- name: compile and release
79-
80-
env:
81-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82-
GOARCH: amd64
83-
GOOS: darwin
84-
EXTRA_FILES: "LICENSE"
85-
GO111MODULE: on
86-
release-windows-386:
87-
name: release windows/386
88-
runs-on: ubuntu-latest
6+
lint:
7+
name: Lint files
8+
runs-on: 'ubuntu-latest'
899
steps:
90-
- uses: actions/checkout@master
91-
- uses: actions/setup-go@v2
92-
with:
93-
go-version: '^1.16.1'
94-
- name: compile and release
95-
96-
env:
97-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98-
GOARCH: "386"
99-
GOOS: windows
100-
EXTRA_FILES: "LICENSE"
101-
GO111MODULE: on
102-
release-windows-amd64:
103-
name: release windows/amd64
10+
- uses: actions/checkout@master
11+
- uses: actions/setup-go@v2
12+
with:
13+
go-version: '^1.16.3'
14+
- name: golangci-lint
15+
uses: golangci/[email protected]
16+
with:
17+
version: latest
18+
releases-matrix:
19+
name: Release Matrix
10420
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
goos: [linux, windows, darwin]
24+
goarch: ["386", amd64]
25+
exclude:
26+
# windows/386 and darwin/386 seems useless
27+
- goarch: "386"
28+
goos: windows
29+
- goarch: "386"
30+
goos: darwin
31+
10532
steps:
106-
- uses: actions/checkout@master
107-
- uses: actions/setup-go@v2
108-
with:
109-
go-version: '^1.16.1'
110-
- name: compile and release
111-
112-
env:
113-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114-
GOARCH: amd64
115-
GOOS: windows
116-
EXTRA_FILES: "LICENSE"
117-
GO111MODULE: on
33+
- uses: actions/checkout@master
34+
35+
- uses: actions/setup-go@v2
36+
with:
37+
go-version: '^1.16.3'
38+
39+
- name: Set APP_VERSION env
40+
run: echo APP_VERSION=$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev ) >> ${GITHUB_ENV}
41+
42+
- name: Environment Printer
43+
uses: managedkaos/[email protected]
44+
45+
- uses: wangyoucao577/[email protected]
46+
with:
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
goos: ${{ matrix.goos }}
49+
goarch: ${{ matrix.goarch }}
50+
project_path: "${{ env.CMD_PATH }}"
51+
build_flags: -v

0 commit comments

Comments
 (0)