-
Notifications
You must be signed in to change notification settings - Fork 30
220 lines (213 loc) · 9.35 KB
/
build.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
name: Build
run-name: "Build: ${{ github.ref_name }} . ${{ inputs.tag || 'latest' }}"
on:
workflow_dispatch:
inputs:
tag:
description: 'Specific tag for building'
required: false
default: ''
jobs:
prepare:
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.version.outputs.value }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag || steps.branch-name.outputs.ref_branch }}
- name: Detect actual version
id: version
run: |
VERSION=$(./share/version.sh)
echo "value=$VERSION" >> $GITHUB_OUTPUT
build-linux:
runs-on: ubuntu-20.04
needs: prepare
steps:
- name: OS Information
run: |
uname -a
cat /etc/*release
- name: Check out Git repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag || steps.branch-name.outputs.ref_branch }}
- name: Install general dependencies
run: sudo apt update && sudo apt install -y build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler libqrencode-dev libzmq3-dev libminiupnpc-dev
- name: Build depends
run: cd depends && make HOST=x86_64-pc-linux-gnu && cd ..
- name: Configure
run: |
./autogen.sh
CONFIG_SITE=$PWD/depends/x86_64-pc-linux-gnu/share/config.site ./configure --prefix=/usr/local
- name: Make
run: |
make
make deploy
- name: Prepare output binaries
run: |
VERSION=${{ needs.prepare.outputs.version }}
mkdir ./out/
cp ./release/usr/local/bin/pocketcoind ./out/pocketnetcore_${VERSION}_linux_x64_daemon.bin
cp ./pocketnetcore_*_linux_x64_setup.deb ./out/pocketnetcore_${VERSION}_linux_x64_setup.deb
cp ./pocketnetcore_*_linux_x64.tar.gz ./out/pocketnetcore_${VERSION}_linux_x64.tar.gz
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Linux_x64
path: ./out/*
build-windows:
runs-on: ubuntu-20.04
needs: prepare
steps:
- name: OS Information
run: |
uname -a
cat /etc/*release
- name: Check out Git repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag || steps.branch-name.outputs.ref_branch }}
- name: Install general dependencies
run: |
sudo apt update && sudo apt install -y build-essential libtool autotools-dev automake pkg-config nsis g++-mingw-w64-x86-64
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
- name: Build depends
run: cd depends && make HOST=x86_64-w64-mingw32 && cd ..
- name: Configure
run: |
./autogen.sh
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
- name: Make
run: |
make
make deploy
- name: Prepare output binaries
run: |
VERSION=${{ needs.prepare.outputs.version }}
mkdir ./out/
cp ./release/pocketcoind.exe ./out/pocketnetcore_${VERSION}_win_x64_daemon.bin
cp ./pocketnetcore_*_win_x64_setup.exe ./out/pocketnetcore_${VERSION}_win_x64_setup.exe
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Windows_x64
path: ./out/*
build-macos-arm64:
runs-on: macos-14
needs: prepare
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
ref: ${{ steps.branch-name.outputs.ref_branch }}
- name: Install general dependencies
run: brew install automake make libtool miniupnpc protobuf qrencode librsvg python-setuptools
- name: Build depends
run: cd depends && make && cd ..
- name: Configure
run: |
./autogen.sh
./configure --prefix=$PWD/depends/arm-apple-darwin23.6.0
- name: Make
run: |
make
make deploy
- name: Sign App
env:
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --options runtime dist/Pocketcoin-Qt.app -v
- name: Notarize App
env:
PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
run: |
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD"
ditto -c -k --keepParent "dist/Pocketcoin-Qt.app" "notarization.zip"
xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait
xcrun stapler staple "dist/Pocketcoin-Qt.app"
- name: Build DMG image
run: |
./contrib/macdeploy/createdmg Pocketcoin-Qt.app Pocketnet-Core
- name: Prepare output binaries
run: |
VERSION=${{ needs.prepare.outputs.version }}
mkdir ./out/
cp ./src/pocketcoind ./out/pocketnetcore_${VERSION}_macos_arm64_daemon.bin
cp ./Pocketnet-Core.dmg ./out/pocketnetcore_${VERSION}_macos_arm64_setup.dmg
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: MacOS_arm64
path: ./out/*
build-macos-amd64:
runs-on: macos-13
needs: prepare
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install general dependencies
run: |
brew install automake make miniupnpc protobuf qrencode librsvg python-setuptools berkeley-db@4
pip3 install setuptools
- name: Build depends
run: cd depends && make && cd ..
- name: Configure
run: |
./autogen.sh
./configure --prefix=$PWD/depends/x86_64-apple-darwin22.6.0
- name: Make
run: |
make
make deploy
- name: Sign App
env:
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --options runtime dist/Pocketcoin-Qt.app -v
- name: Notarize App
env:
PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
run: |
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD"
ditto -c -k --keepParent "dist/Pocketcoin-Qt.app" "notarization.zip"
xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait
xcrun stapler staple "dist/Pocketcoin-Qt.app"
- name: Build DMG image
run: |
./contrib/macdeploy/createdmg Pocketcoin-Qt.app Pocketnet-Core
- name: Prepare output binaries
run: |
VERSION=${{ needs.prepare.outputs.version }}
mkdir ./out/
cp ./src/pocketcoind ./out/pocketnetcore_${VERSION}_macos_x64_daemon.bin
cp ./Pocketnet-Core.dmg ./out/pocketnetcore_${VERSION}_macos_x64_setup.dmg
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: MacOS_x64
path: ./out/*