4
4
branches :
5
5
- master
6
6
- staging
7
+ - sprint*
7
8
tags :
8
9
- ' v*.*.*'
10
+ pull_request :
9
11
10
12
jobs :
11
13
build-linux :
@@ -16,44 +18,18 @@ jobs:
16
18
run : |
17
19
sudo apt update
18
20
sudo apt -y install build-essential nghttp2 libnghttp2-dev libssl-dev
19
-
21
+
20
22
- name : Setup go 1.18
21
23
uses : actions/setup-go@v2
22
24
with :
23
25
go-version : ^1.20.0 # The Go version to download (if necessary) and use.
24
26
25
27
- name : Checkout
26
28
uses : actions/checkout@v2
27
-
28
- - name : Set GITHUB_ENV
29
- run : |
30
- echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
31
-
32
- if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
33
- echo "TAG=v0.0.0-master" >> $GITHUB_ENV
34
- elif [[ "${{github.base_ref}}" == "dev" || "${{github.ref}}" == "refs/heads/dev" ]]; then
35
- echo "TAG=v0.0.0-dev" >> $GITHUB_ENV
36
- elif [[ "${{github.base_ref}}" == "staging" || "${{github.ref}}" == "refs/heads/staging" ]]; then
37
- echo "TAG=v0.0.0-staging" >> $GITHUB_ENV
38
- else
39
- echo "TAG=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
40
- fi
41
29
42
30
- name : Install
43
31
run : make install
44
32
45
- - name : Zip release
46
- run : tar -czvf zwallet-linux.tar.gz ./zwallet
47
-
48
- - name : Upload binaries to release
49
- uses : svenstaro/upload-release-action@v2
50
- with :
51
- repo_token : ${{ secrets.GITHUB_TOKEN }}
52
- file : zwallet-linux.tar.gz
53
- tag : ${{ env.TAG }}
54
- overwrite : true
55
- file_glob : true
56
-
57
33
- name : ' Upload Artifact'
58
34
uses : actions/upload-artifact@v2
59
35
with :
@@ -64,51 +40,61 @@ jobs:
64
40
build-windows :
65
41
name : Build-windows
66
42
runs-on : windows-runner
43
+ defaults :
44
+ run :
45
+ shell : msys2 {0}
46
+ strategy :
47
+ matrix :
48
+ sys : [ MINGW64 ]
67
49
steps :
68
- - name : Setup go
69
- uses : actions/setup-go@v3
50
+ - uses : msys2/setup-msys2@v2
70
51
with :
71
- go-version : ^1.20.0 # The Go version to download (if necessary) and use.
52
+ msystem : ${{matrix.sys}}
53
+
54
+ - name : Install libraries
55
+ run : |
56
+ echo 'Y'| pacman -S base-devel git gcc make
57
+
58
+ - name : Install Clang and Go for MINGW64
59
+ run : |
60
+ echo 'y'| pacman -S mingw-w64-x86_64-clang mingw-w64-x86_64-go zip unzip
61
+
62
+ - name : Set environment variables
63
+ run : |
64
+ export GOROOT=/mingw64/lib/go
65
+ export GOPATH=/mingw64
66
+ export PATH=$PATH:$GOROOT/bin
67
+ export PATH=$PATH:/usr/bin/7z
68
+
69
+ # use clang as a default compiler for CGO
70
+ go env -w "CC=/mingw64/bin/clang.exe"
72
71
73
72
- name : Checkout
74
73
uses : actions/checkout@v2
75
74
76
- - name : Set GITHUB_ENV
77
- run : |
78
- IF ( "${{github.base_ref}}" -eq "master" -OR "${{github.ref}}" -eq "refs/heads/master" ){
79
- echo "TAG=v0.0.0-master" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
80
- } ElseIf ( "${{github.base_ref}}" -eq "dev" -OR "${{github.ref}}" -eq "refs/heads/dev" ){
81
- echo "TAG=v0.0.0-dev" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
82
- } ElseIf ( "${{github.base_ref}}" -eq "staging" -OR "${{github.ref}}" -eq "refs/heads/staging" ){
83
- echo "TAG=v0.0.0-staging" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
84
- } ELSE {
85
- echo "TAG=${{github.ref}}" | %{$_ -replace('refs/tags/', '')} | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
86
- }
87
-
88
-
89
75
- name : Install
90
76
run : make install
91
-
77
+
92
78
- name : Zip release
93
79
run : |
94
- copy zwallet zwallet.exe
95
- 7z a zwallet-windows.zip zwallet.exe
96
-
97
- - name : Upload binaries to release
98
- uses : svenstaro/upload-release-action@v2
99
- with :
100
- repo_token : ${{ secrets.GITHUB_TOKEN }}
101
- file : zwallet-windows.zip
102
- tag : ${{ env.TAG }}
103
- overwrite : true
104
- file_glob : true
80
+ # download dll files
81
+ wget https://github.com/0chain/zboxcli/files/11840033/windows.dll.s.zip
82
+ unzip -o windows.dll.s.zip
83
+ cp zwallet zwallet.exe
84
+ zip zwallet-windows.zip zwallet.exe libgcc_s_seh-1.dll libstdc++-6.dll libwinpthread-1.dll
105
85
106
86
- name : ' Upload Artifact'
107
87
uses : actions/upload-artifact@v2
108
88
with :
109
- name : zwallet-windows
110
- path : zwallet
89
+ name : zwallet-windows.zip
90
+ path : zwallet-windows.zip
111
91
retention-days : 5
92
+
93
+ - name : cleanup workspace
94
+ run : |
95
+ rm -Recurse ${{github.workspace}}\*
96
+ shell : powershell
97
+
112
98
build-macos :
113
99
name : Build-macos
114
100
runs-on : macos-runner
@@ -119,34 +105,9 @@ jobs:
119
105
go-version : ^1.20.0 # The Go version to download (if necessary) and use.
120
106
- name : Checkout
121
107
uses : actions/checkout@v2
122
-
123
- - name : Set GITHUB_ENV
124
- run : |
125
- echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
126
-
127
- if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
128
- echo "TAG=v0.0.0-master" >> $GITHUB_ENV
129
- elif [[ "${{github.base_ref}}" == "dev" || "${{github.ref}}" == "refs/heads/dev" ]]; then
130
- echo "TAG=v0.0.0-dev" >> $GITHUB_ENV
131
- elif [[ "${{github.base_ref}}" == "staging" || "${{github.ref}}" == "refs/heads/staging" ]]; then
132
- echo "TAG=v0.0.0-staging" >> $GITHUB_ENV
133
- else
134
- echo "TAG=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
135
- fi
136
108
137
109
- name : Install
138
110
run : make install
139
- - name : Zip release
140
- run : tar -czvf zwallet-macos.tar.gz ./zwallet
141
-
142
- - name : Upload binaries to release
143
- uses : svenstaro/upload-release-action@v2
144
- with :
145
- repo_token : ${{ secrets.GITHUB_TOKEN }}
146
- file : zwallet-macos.tar.gz
147
- tag : ${{ env.TAG }}
148
- overwrite : true
149
- file_glob : true
150
111
151
112
- name : ' Upload Artifact'
152
113
uses : actions/upload-artifact@v2
0 commit comments