forked from jayhines91/verium
-
Notifications
You must be signed in to change notification settings - Fork 0
223 lines (190 loc) · 7.81 KB
/
Copy pathLinux64.yml
File metadata and controls
223 lines (190 loc) · 7.81 KB
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
name: Build Verium (Linux x86_64 • depends)
on:
push:
branches: [ testnet ]
workflow_dispatch:
inputs:
target_ref:
description: "Branch/Tag/SHA to build"
required: true
default: "testnet"
depends_target:
description: "Optional: build only this depends pkg first (e.g., boost, openssl). Leave empty for full depends."
required: false
default: ""
verbose_make:
description: "Verbose make output (V=1)"
required: false
default: "false"
concurrency:
group: verium-linux
cancel-in-progress: true
permissions:
contents: write
defaults:
run:
shell: bash
env:
HOST_TRIPLET: x86_64-pc-linux-gnu
jobs:
linux64:
runs-on: ubuntu-22.04
env:
HOST_TRIPLET: x86_64-pc-linux-gnu
# NEW: force toolchain to GCC 9 everywhere
CC: gcc-9
CXX: g++-9
steps:
- name: Checkout target ref
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.target_ref || github.ref }}
submodules: recursive
fetch-depth: 0
- name: Select GCC 9 toolchain (Linux)
if: runner.os == 'Linux'
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y gcc-9 g++-9
# Make gcc/g++ point to version 9 everywhere (covers scripts that hardcode 'gcc')
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 \
--slave /usr/bin/g++ g++ /usr/bin/g++-9 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-9 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-9 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-9 \
--slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-9
gcc --version
g++ --version
- name: Export GCC 9 env (Linux)
if: runner.os == 'Linux'
run: |
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
echo "CPP=gcc -E" >> $GITHUB_ENV
echo "AR=ar" >> $GITHUB_ENV
echo "RANLIB=ranlib" >> $GITHUB_ENV
echo "NM=nm" >> $GITHUB_ENV
- name: Base build deps (host)
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y \
build-essential automake libtool pkg-config python3 \
curl zip unzip ccache \
gcc-9 g++-9 gcc-11 g++-11
"$CC" --version; "$CXX" --version
- name: Build depends (Linux)
run: |
set -e
# If user asked to prime a single depends target, do it first (with GCC 9)
if [ -n "${{ inputs.depends_target }}" ]; then
echo "Priming depends target: ${{ inputs.depends_target }}"
CC=gcc-9 CXX=g++-9 make -C depends HOST=${HOST_TRIPLET} \
${{ inputs.depends_target }} -j"$(nproc || echo 2)"
fi
# Always pre-build FreeType with GCC 11 (it’s a C lib; ABI-safe)
echo "Priming FreeType with GCC 11"
make -C depends HOST=${HOST_TRIPLET} CC=gcc-11 CXX=g++-11 freetype -j"$(nproc || echo 2)"
# Build everything else with GCC 9
export CC=gcc-9 CXX=g++-9
make -C depends HOST=${HOST_TRIPLET} -j"$(nproc || echo 2)" || {
echo "---- tail any config.log ----"
find depends/work/build -name config.log -exec sh -c 'echo "==> {}"; tail -n 120 "{}"' \;
exit 1
}
- name: Configure (Linux)
run: |
set -e
./autogen.sh
export CONFIG_SITE="$(pwd)/depends/${HOST_TRIPLET}/share/config.site"
DEP="$(pwd)/depends/${HOST_TRIPLET}"
# Make configure search depends first
export BOOST_CPPFLAGS="-I$DEP/include"
export BOOST_LDFLAGS="-L$DEP/lib"
export CPPFLAGS="$BOOST_CPPFLAGS ${CPPFLAGS:-}"
export LDFLAGS="$BOOST_LDFLAGS ${LDFLAGS:-}"
# Detect the exact Boost suffix produced by depends (e.g. -mt-x64)
bs="$(ls "$DEP/lib"/libboost_system*.a | head -n1 || true)"
if [ -z "$bs" ]; then
echo "ERROR: No libboost_system*.a found in $DEP/lib (did depends/boost build?)."
ls -l "$DEP/lib" || true
exit 1
fi
suf="${bs##*/}"; suf="${suf#libboost_system}"; suf="${suf%.a}"
export BOOST_LIB_SUFFIX="$suf"
export BOOST_THREAD_LIB_SUFFIX="$suf" # some macros still read this
echo "Using BOOST_LIB_SUFFIX='$BOOST_LIB_SUFFIX'"
# Helpful when linking statically
export LIBS="${LIBS:-} -pthread -lrt"
# Pass CC/CXX explicitly; also hint where Boost lives
CC="${CC:-gcc-9}" CXX="${CXX:-g++-9}" \
./configure \
--host=${HOST_TRIPLET} \
--prefix="$DEP" \
--with-gui=qt5 \
--with-qt-bindir="$DEP/native/bin" \
--with-qt-incdir="$DEP/include" \
--with-qt-libdir="$DEP/lib" \
--with-boost="$DEP" \
--with-boost-libdir="$DEP/lib" \
--disable-bench --disable-tests \
--enable-reduce-exports \
--disable-shared --enable-static
- name: Build (Linux)
run: |
set -e
if [ "${{ inputs.verbose_make }}" = "true" ]; then
make CC="$CC" CXX="$CXX" -j"$(nproc || echo 2)" V=1
else
make CC="$CC" CXX="$CXX" -j"$(nproc || echo 2)"
fi
- name: Package + checksums (Linux)
run: |
set -euo pipefail
V=$(grep '^PACKAGE_VERSION' Makefile 2>/dev/null | sed 's/.*= *//' | tr -d ' ') || echo "1.3.5.2"
OUTDIR="out-linux"
rm -rf "$OUTDIR"
mkdir -p "$OUTDIR"/{daemon,doc,manpages,share/applications,share/pixmaps,share/icons/hicolor/128x128/apps}
# Root: GUI binary, COPYING, readme (matches Windows layout)
cp -f src/qt/verium-qt "$OUTDIR/"
cp -f COPYING "$OUTDIR/"
cp -f doc/README_windows.txt "$OUTDIR/readme.txt"
# daemon/: CLI tools (matches Windows)
cp -f src/veriumd src/verium-cli src/verium-tx src/verium-wallet "$OUTDIR/daemon/" 2>/dev/null || true
# doc/: release notes and docs (matches Windows)
cp -r doc "$OUTDIR/"
rm -rf "$OUTDIR/doc/man"
find "$OUTDIR/doc" -name 'Makefile*' -delete 2>/dev/null || true
# manpages/: all man pages (matches Windows)
./contrib/release-tools/gather-manpages.sh "$OUTDIR/manpages"
# share/: .desktop launcher and icon for verium-qt
cp -f share/applications/verium-qt.desktop "$OUTDIR/share/applications/"
cp -f share/pixmaps/verium-qt.png "$OUTDIR/share/pixmaps/"
cp -f share/pixmaps/verium-qt.png "$OUTDIR/share/icons/hicolor/128x128/apps/"
cp -f contrib/release-tools/INSTALL_LINUX.txt "$OUTDIR/"
if [ -z "$(ls -A "$OUTDIR" 2>/dev/null)" ] || [ ! -f "$OUTDIR/verium-qt" ]; then
echo "No Linux binaries found in $OUTDIR; exiting."
exit 2
fi
PKG="verium-${V}-x86_64-pc-linux-gnu.tar.gz"
tar -C "$OUTDIR" -czf "$PKG" .
sha256sum "$PKG" > "${PKG}.SHA256SUMS"
echo "ART_MAIN=$PKG" >> $GITHUB_ENV
echo "ART_SUMS=${PKG}.SHA256SUMS" >> $GITHUB_ENV
- name: Upload artifacts (binaries + checksums)
uses: actions/upload-artifact@v4
with:
name: linux64-${{ env.HOST_TRIPLET }}
path: |
${{ env.ART_MAIN }}
${{ env.ART_SUMS }}
- name: Upload build logs (for debugging)
if: always()
uses: actions/upload-artifact@v4
with:
name: linux-dep-logs
path: |
depends/work/build/**/config.log
depends/work/build/**/config.status
if-no-files-found: ignore