@@ -4,11 +4,11 @@ name: CI
4
4
on :
5
5
# Triggers the workflow on push or pull request events but only for the main branch
6
6
push :
7
- branches : [ master ]
7
+ branches : [master]
8
8
tags :
9
- - ' * '
9
+ - " * "
10
10
pull_request :
11
- branches : [ master ]
11
+ branches : [master]
12
12
13
13
# Allows you to run this workflow manually from the Actions tab
14
14
workflow_dispatch :
19
19
build :
20
20
# The type of runner that the job will run on
21
21
runs-on : ubuntu-latest
22
-
22
+
23
23
strategy :
24
24
matrix :
25
25
os : [linux, darwin]
@@ -28,12 +28,17 @@ jobs:
28
28
# Steps represent a sequence of tasks that will be executed as part of the job
29
29
steps :
30
30
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
31
- - uses : actions/checkout@v2
32
-
31
+ - uses : actions/checkout@v3
32
+
33
33
- name : Setup Go environment
34
- uses : actions/setup-go@v2.1.4
34
+ uses : actions/setup-go@v3
35
35
with :
36
- go-version : 1.17
36
+ # The Go version to download (if necessary) and use. Supports semver spec and ranges.
37
+ go-version : 1.20.1
38
+ # Whether to download only stable versions
39
+ # stable: # optional, default is true
40
+ # Used to pull node distributions from go-versions. Since there's a default, this is typically not supplied by the user.
41
+ # token: # optional, default is ${{ github.token }}
37
42
38
43
- name : Build executable
39
44
run : |
@@ -43,15 +48,14 @@ jobs:
43
48
env :
44
49
GOOS : ${{ matrix.os }}
45
50
GOARCH : ${{ matrix.arch }}
46
-
51
+
47
52
- name : compress executable
48
53
run : |
49
- # apt update && apt install zip -y
50
- cd dist
54
+ cd ./dist
51
55
chmod +x cloudpile
52
56
zip cloudpile-${{ matrix.os }}-${{ matrix.arch }}.zip cloudpile
53
57
ls -lha .
54
-
58
+
55
59
- name : Release
56
60
uses : softprops/action-gh-release@v1
57
61
if : startsWith(github.ref, 'refs/tags/')
@@ -66,12 +70,10 @@ jobs:
66
70
needs : build
67
71
68
72
steps :
69
-
70
73
- name : Docker meta
71
74
id : meta
72
75
uses : docker/metadata-action@v3
73
76
with :
74
-
75
77
# list of Docker images to use as base name for tags
76
78
images : |
77
79
quay.io/wasilak/cloudpile
@@ -87,17 +89,17 @@ jobs:
87
89
88
90
- name : Set up QEMU
89
91
uses : docker/setup-qemu-action@v1
90
-
92
+
91
93
- name : Set up Docker Buildx
92
94
uses : docker/setup-buildx-action@v1
93
-
95
+
94
96
- name : Login to Quay.io
95
97
uses : docker/login-action@v1
96
98
with :
97
99
registry : quay.io
98
100
username : ${{ secrets.QUAY_IO_LOGIN }}
99
101
password : ${{ secrets.QUAY_IO_PASSWORD }}
100
-
102
+
101
103
- name : Build and push
102
104
id : docker_build
103
105
uses : docker/build-push-action@v2
@@ -106,4 +108,3 @@ jobs:
106
108
push : ${{ github.event_name != 'pull_request' }}
107
109
tags : ${{ steps.meta.outputs.tags }}
108
110
labels : ${{ steps.meta.outputs.labels }}
109
-
0 commit comments