-
Notifications
You must be signed in to change notification settings - Fork 0
211 lines (179 loc) · 7.69 KB
/
Copy pathrelease.yml
File metadata and controls
211 lines (179 loc) · 7.69 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
name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
# ---------- Linux tar.gz ----------
build-linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libtool autotools-dev autoconf \
pkg-config bsdmainutils curl python3
- name: Build depends
run: make -C depends HOST=x86_64-linux-gnu NO_QT=1 -j$(nproc)
- name: Build
run: |
./autogen.sh
CONFIG_SITE=$PWD/depends/x86_64-linux-gnu/share/config.site ./configure --prefix=/ --without-gui --disable-zmq
make -j$(nproc)
strip src/faircoind src/faircoin-cli src/faircoin-tx
- name: Package tar.gz
run: |
mkdir -p faircoin-${{ github.ref_name }}-linux-x86_64
cp src/faircoind src/faircoin-cli src/faircoin-tx faircoin-${{ github.ref_name }}-linux-x86_64/
cp COPYING README.md doc/GENERATE-KEYS.md faircoin-${{ github.ref_name }}-linux-x86_64/
tar czf faircoin-${{ github.ref_name }}-linux-x86_64.tar.gz faircoin-${{ github.ref_name }}-linux-x86_64/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linux-tarball
path: faircoin-${{ github.ref_name }}-linux-x86_64.tar.gz
# ---------- Debian .deb package ----------
build-deb:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libtool autotools-dev autoconf \
pkg-config bsdmainutils curl python3 \
dpkg-dev fakeroot
- name: Build depends
run: make -C depends HOST=x86_64-linux-gnu NO_QT=1 -j$(nproc)
- name: Build
run: |
./autogen.sh
CONFIG_SITE=$PWD/depends/x86_64-linux-gnu/share/config.site ./configure --prefix=/ --without-gui --disable-zmq
make -j$(nproc)
strip src/faircoind src/faircoin-cli src/faircoin-tx
- name: Create .deb package
run: |
VERSION="${GITHUB_REF_NAME#v}"
PKG="faircoin_${VERSION}_amd64"
mkdir -p $PKG/DEBIAN $PKG/usr/bin $PKG/usr/share/doc/faircoin
# Binaries
cp src/faircoind src/faircoin-cli src/faircoin-tx $PKG/usr/bin/
# Docs
cp COPYING README.md doc/GENERATE-KEYS.md $PKG/usr/share/doc/faircoin/
# Control file (statically linked — only libc6 needed)
cat > $PKG/DEBIAN/control <<EOF
Package: faircoin
Version: ${VERSION}
Section: net
Priority: optional
Architecture: amd64
Depends: libc6
Maintainer: FairCoin Official <contact@fairco.in>
Description: FairCoin cryptocurrency daemon and CLI
FairCoin is a cryptocurrency with masternodes, coin mixing,
and hybrid PoW/PoS consensus. This package provides the
faircoind daemon and faircoin-cli/faircoin-tx tools.
Homepage: https://fairco.in
EOF
dpkg-deb --build --root-owner-group $PKG
ls -la $PKG.deb
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linux-deb
path: faircoin_*_amd64.deb
# ---------- Windows .exe (cross-compile) ----------
build-windows:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install cross-compile dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libtool autotools-dev autoconf \
pkg-config bsdmainutils curl python3 \
g++-mingw-w64-x86-64 mingw-w64-x86-64-dev \
nsis
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
- name: Build depends for Windows
run: |
cd depends
make HOST=x86_64-w64-mingw32 -j$(nproc)
- name: Build FairCoin for Windows
run: |
./autogen.sh
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/ --disable-zmq
make -j$(nproc)
x86_64-w64-mingw32-strip src/faircoind.exe src/faircoin-cli.exe src/faircoin-tx.exe src/qt/faircoin-qt.exe
- name: Package Windows ZIP
run: |
mkdir -p faircoin-${{ github.ref_name }}-windows-x86_64
cp src/faircoind.exe src/faircoin-cli.exe src/faircoin-tx.exe src/qt/faircoin-qt.exe faircoin-${{ github.ref_name }}-windows-x86_64/
cp COPYING README.md doc/GENERATE-KEYS.md faircoin-${{ github.ref_name }}-windows-x86_64/
zip -r faircoin-${{ github.ref_name }}-windows-x86_64.zip faircoin-${{ github.ref_name }}-windows-x86_64/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows-zip
path: faircoin-${{ github.ref_name }}-windows-x86_64.zip
# ---------- macOS (native build) ----------
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install automake libtool pkg-config openssl@3 boost berkeley-db@4 miniupnpc libevent
brew link --force berkeley-db@4
- name: Build
run: |
export LDFLAGS="-L$(brew --prefix boost)/lib -L$(brew --prefix openssl@3)/lib -L$(brew --prefix berkeley-db@4)/lib -L$(brew --prefix miniupnpc)/lib -L$(brew --prefix libevent)/lib"
export CPPFLAGS="-I$(brew --prefix boost)/include -I$(brew --prefix openssl@3)/include -I$(brew --prefix berkeley-db@4)/include -I$(brew --prefix miniupnpc)/include -I$(brew --prefix libevent)/include"
export PKG_CONFIG_PATH="$(brew --prefix openssl@3)/lib/pkgconfig:$(brew --prefix libevent)/lib/pkgconfig"
./autogen.sh
./configure --without-gui --with-incompatible-bdb --disable-zmq \
--with-boost=$(brew --prefix boost)
make -j$(sysctl -n hw.ncpu)
strip src/faircoind src/faircoin-cli src/faircoin-tx
- name: Package macOS
run: |
ARCH=$(uname -m)
mkdir -p faircoin-${{ github.ref_name }}-macos-${ARCH}
cp src/faircoind src/faircoin-cli src/faircoin-tx faircoin-${{ github.ref_name }}-macos-${ARCH}/
cp COPYING README.md doc/GENERATE-KEYS.md faircoin-${{ github.ref_name }}-macos-${ARCH}/
tar czf faircoin-${{ github.ref_name }}-macos-${ARCH}.tar.gz faircoin-${{ github.ref_name }}-macos-${ARCH}/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: macos-tarball
path: faircoin-${{ github.ref_name }}-macos-*.tar.gz
# ---------- Create GitHub Release ----------
create-release:
needs: [build-linux, build-deb, build-windows, build-macos]
if: always()
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: List artifacts
run: find artifacts -type f || echo "No artifacts found"
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: FairCoin ${{ github.ref_name }}
draft: false
prerelease: false
generate_release_notes: true
fail_on_unmatched_files: false
files: |
artifacts/linux-tarball/*.tar.gz
artifacts/linux-deb/*.deb
artifacts/windows-zip/*.zip
artifacts/macos-tarball/*.tar.gz