forked from cryptonotefoundation/cryptonote
-
Notifications
You must be signed in to change notification settings - Fork 66
235 lines (216 loc) · 8.07 KB
/
check.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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
name: Build check
on:
push:
branches:
- '**'
tags-ignore:
- '*' # We don't want this to run on release
pull_request:
jobs:
build-windows:
name: Windows
runs-on: windows-2019
env:
BOOST_ROOT: C:\thirdparties\boost-1.72.0
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Install OpenSSL
run: choco install openssl
- name: Install Boost
shell: powershell
run: |
$Url = "https://sourceforge.net/projects/boost/files/boost-binaries/1.72.0/boost_1_72_0-msvc-14.2-64.exe"
(New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\boost-installer.exe")
Start-Process -Wait -FilePath "$env:TEMP\boost-installer.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=$env:BOOST_ROOT"
- name: Build
shell: powershell
id: build
run: |
$build_folder = "build"
$sha = "${{ github.sha }}"
$krb_ver = $sha.SubString(0,7)
$release_name = "karbo-cli-win64-$krb_ver"
mkdir "$build_folder"
cd "$build_folder"
cmake -G "Visual Studio 16 2019" -A x64 -DBOOST_ROOT="$env:BOOST_ROOT" -DBOOST_INCLUDE_DIRS="$env:BOOST_ROOT/include" ..
msbuild Karbowanec.sln /p:Configuration=Release /m
cd src\Release
Compress-Archive -Path *.exe -DestinationPath "$release_name.zip"
$sha256 = (Get-FileHash "$release_name.zip").Hash
$asset_path = "./$build_folder/src/Release/$release_name.zip"
mkdir "$release_name"
cp *.exe "$release_name/"
echo "sha256=${sha256}" >> $env:GITHUB_OUTPUT
echo "release_name=${release_name}.zip" >> $env:GITHUB_OUTPUT
echo "asset_path=${asset_path}" >> $env:GITHUB_OUTPUT
echo "krb_ver=${krb_ver}" >> $env:GITHUB_OUTPUT
echo "artifact_path=$build_folder/src/Release/$release_name" >> $env:GITHUB_OUTPUT
- name: Upload To GH Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build.outputs.release_name }}
path: ${{ steps.build.outputs.artifact_path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-mingw:
name: MinGW
runs-on: windows-2019
steps:
- uses: msys2/setup-msys2@v2
with:
update: true
install: >-
git
base-devel
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-boost
mingw-w64-x86_64-cmake
mingw-w64-x86_64-openssl
- uses: actions/checkout@master
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Prepare version
shell: powershell
id: setup
run: |
$krb_ver="${{ github.sha }}".SubString(0,7)
$release_name="karbo-cli-win64-mingw-$krb_ver"
echo "release_name=${release_name}" >> $env:GITHUB_OUTPUT
- name: Build
shell: msys2 {0}
id: build
run: |
ls
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DSTATIC=ON
cmake --build . --config Release
- name: Prepare release
shell: msys2 {0}
run: |
mkdir build/karbo
mv build/src/karbowanecd.exe build/karbo
mv build/src/simplewallet.exe build/karbo
mv build/src/greenwallet.exe build/karbo
mv build/src/optimizer.exe build/karbo
mv build/src/walletd.exe build/karbo
mv build/src/vanitygen.exe build/karbo
- name: Upload To GH Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.setup.outputs.release_name }}
path: build/karbo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-macos:
name: macOS
runs-on: macos-12
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Build
id: build
run: |
build_folder="build/"
krb_ver=${GITHUB_SHA::7}
release_name="Karbo-cli-macOS-$krb_ver"
brew install --force openssl boost gcc
brew link openssl boost --force
mkdir "$build_folder"
cd "$build_folder"
cmake -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" -DOPENSSL_USE_STATIC_LIBS=ON ..
make
mkdir "$release_name"
exeFiles=()
for f in src/*; do [[ -x $f && -f $f ]] && strip "$f" && exeFiles+=( "$f" ); done
strip "${exeFiles[@]}"
cp "${exeFiles[@]}" "$release_name/"
zip -r "$release_name".zip "$release_name"
sha256=$(shasum -a 256 "$release_name".zip | awk '{print toupper($1)}')
asset_path="./$build_folder$release_name.zip"
echo "sha256=${sha256}" >> $GITHUB_OUTPUT
echo "release_name=${release_name}.zip" >> $GITHUB_OUTPUT
echo "asset_path=${asset_path}" >> $GITHUB_OUTPUT
echo "krb_ver=${krb_ver}" >> $GITHUB_OUTPUT
echo "artifact_path=$build_folder/$release_name" >> $GITHUB_OUTPUT
- name: Upload To GH Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build.outputs.release_name }}
path: ${{ steps.build.outputs.artifact_path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-ubuntu22:
name: Ubuntu 22.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Build
id: build
run: |
sudo apt-get update && sudo apt-get install -y libboost-all-dev
build_folder="build/release"
krb_ver=${GITHUB_SHA::7}
release_name=Karbo-cli-ubuntu22.04-"$krb_ver"
mkdir -p "$build_folder"
cd "$build_folder"
cmake -D ARCH=default -D CMAKE_BUILD_TYPE=Release -D CMAKE_POSITION_INDEPENDENT_CODE:BOOL=true -D BOOST_IGNORE_SYSTEM_PATHS_DEFAULT=ON -D BOOST_ROOT=/usr ../..
make
mkdir -p "$release_name"
exeFiles=()
for f in src/*; do [[ -x $f && -f $f ]] && exeFiles+=( "$f" ); done
strip "${exeFiles[@]}"
cp "${exeFiles[@]}" "$release_name/"
echo "release_name=${release_name}" >> $GITHUB_OUTPUT
echo "artifact_path=$build_folder/$release_name" >> $GITHUB_OUTPUT
- name: Upload To GH Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build.outputs.release_name }}
path: ${{ steps.build.outputs.artifact_path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-ubuntu20:
name: Ubuntu 20.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Build
id: build
run: |
sudo apt-get update && sudo apt-get install -y libboost-all-dev
build_folder="build/release"
krb_ver=${GITHUB_SHA::7}
release_name=Karbo-cli-ubuntu20.04-"$krb_ver"
mkdir -p "$build_folder"
cd "$build_folder"
cmake -D ARCH=default -D CMAKE_BUILD_TYPE=Release -D CMAKE_POSITION_INDEPENDENT_CODE:BOOL=true -D BOOST_IGNORE_SYSTEM_PATHS_DEFAULT=ON -D BOOST_ROOT=/usr ../..
make
mkdir -p "$release_name"
exeFiles=()
for f in src/*; do [[ -x $f && -f $f ]] && exeFiles+=( "$f" ); done
strip "${exeFiles[@]}"
cp "${exeFiles[@]}" "$release_name/"
echo "release_name=${release_name}" >> $GITHUB_OUTPUT
echo "artifact_path=$build_folder/$release_name" >> $GITHUB_OUTPUT
- name: Upload To GH Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build.outputs.release_name }}
path: ${{ steps.build.outputs.artifact_path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}