-
Notifications
You must be signed in to change notification settings - Fork 16
156 lines (134 loc) · 5 KB
/
build-zwallet.yaml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: build-zwallet
on:
push:
branches:
- master
- staging
tags:
- 'v*.*.*'
jobs:
build-linux:
name: Build-linux
runs-on: [self-hosted, arc-runner]
steps:
- name: Install deps
run: |
sudo apt update
sudo apt -y install build-essential nghttp2 libnghttp2-dev libssl-dev
- name: Setup go 1.18
uses: actions/setup-go@v2
with:
go-version: ^1.20.0 # The Go version to download (if necessary) and use.
- name: Checkout
uses: actions/checkout@v2
- name: Set GITHUB_ENV
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
echo "TAG=v0.0.0-master" >> $GITHUB_ENV
elif [[ "${{github.base_ref}}" == "dev" || "${{github.ref}}" == "refs/heads/dev" ]]; then
echo "TAG=v0.0.0-dev" >> $GITHUB_ENV
elif [[ "${{github.base_ref}}" == "staging" || "${{github.ref}}" == "refs/heads/staging" ]]; then
echo "TAG=v0.0.0-staging" >> $GITHUB_ENV
else
echo "TAG=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
fi
- name: Install
run: make install
- name: Zip release
run: tar -czvf zwallet-linux.tar.gz ./zwallet
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: zwallet-linux.tar.gz
tag: ${{ env.TAG }}
overwrite: true
file_glob: true
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
with:
name: zwallet-linux
path: zwallet
retention-days: 5
build-windows:
name: Build-windows
runs-on: windows-latest
steps:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: ^1.20.0 # The Go version to download (if necessary) and use.
- name: Checkout
uses: actions/checkout@v2
- name: Set GITHUB_ENV
run: |
IF ( "${{github.base_ref}}" -eq "master" -OR "${{github.ref}}" -eq "refs/heads/master" ){
echo "TAG=v0.0.0-master" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
} ElseIf ( "${{github.base_ref}}" -eq "dev" -OR "${{github.ref}}" -eq "refs/heads/dev" ){
echo "TAG=v0.0.0-dev" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
} ElseIf ( "${{github.base_ref}}" -eq "staging" -OR "${{github.ref}}" -eq "refs/heads/staging" ){
echo "TAG=v0.0.0-staging" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
} ELSE {
echo "TAG=${{github.ref}}" | %{$_ -replace('refs/tags/', '')} | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
- name: Install
run: make install
- name: Zip release
run: |
copy zwallet zwallet.exe
7z a zwallet-windows.zip zwallet.exe
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: zwallet-windows.zip
tag: ${{ env.TAG }}
overwrite: true
file_glob: true
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
with:
name: zwallet-windows
path: zwallet
retention-days: 5
build-macos:
name: Build-macos
runs-on: macos-latest
steps:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: ^1.20.0 # The Go version to download (if necessary) and use.
- name: Checkout
uses: actions/checkout@v2
- name: Set GITHUB_ENV
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
echo "TAG=v0.0.0-master" >> $GITHUB_ENV
elif [[ "${{github.base_ref}}" == "dev" || "${{github.ref}}" == "refs/heads/dev" ]]; then
echo "TAG=v0.0.0-dev" >> $GITHUB_ENV
elif [[ "${{github.base_ref}}" == "staging" || "${{github.ref}}" == "refs/heads/staging" ]]; then
echo "TAG=v0.0.0-staging" >> $GITHUB_ENV
else
echo "TAG=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
fi
- name: Install
run: make install
- name: Zip release
run: tar -czvf zwallet-macos.tar.gz ./zwallet
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: zwallet-macos.tar.gz
tag: ${{ env.TAG }}
overwrite: true
file_glob: true
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
with:
name: zwallet-macos
path: zwallet
retention-days: 5