-
Notifications
You must be signed in to change notification settings - Fork 361
70 lines (62 loc) · 2.13 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
name: Build binaries
on:
push:
branches: "*"
pull_request:
branches: "*"
paths-ignore:
- 'docs/**'
- '*.md'
- '*.yml'
- '.github'
jobs:
build:
name: ubuntu - Go v1.17
runs-on: ubuntu-20.04
steps:
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y libgpgme-dev libbtrfs-dev libdevmapper-dev
- name: Set up Go 1.17
uses: actions/setup-go@v3
with:
go-version: 1.17
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
path: src/github.com/sealerio/sealer
- name: Check out code lic
working-directory: src/github.com/sealerio/sealer
run: |
wget https://github.com/google/addlicense/releases/download/v1.0.0/addlicense_1.0.0_Linux_x86_64.tar.gz
tar -zxvf addlicense_1.0.0_Linux_x86_64.tar.gz -C $(go env GOPATH)/bin
chmod a+x $(go env GOPATH)/bin/addlicense
rm -rf addlicense_1.0.0_Linux_x86_64.tar.gz
make filelicense
modifyCode=$(git status -s | grep M | wc -l)
git status -s
if [ $modifyCode -eq 0 ] ; then
echo "Lic check ok"
else
echo "Failed git modify files num is $modifyCode. Lic check error,please exec 'make install-addlicense && make filelicense' in your code "
exit -1
fi
- name: Install go ci lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.39.0
- name: Run Linter
run: golangci-lint run -v
working-directory: src/github.com/sealerio/sealer
- name: Make linux
shell: bash
run: |
export MULTI_PLATFORM_BUILD=true
make linux
working-directory: src/github.com/sealerio/sealer
- name: Save build binaries
uses: actions/upload-artifact@v3
with:
name: sealer-binaries
path: src/github.com/sealerio/sealer/_output/assets/*.tar.gz*