forked from NatronGitHub/Natron
-
Notifications
You must be signed in to change notification settings - Fork 1
251 lines (205 loc) · 9.71 KB
/
build_installer.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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
name: Build Installer
on:
workflow_dispatch:
inputs:
push_to_nightly_release:
required: true
type: boolean
default: false
push: {}
schedule:
- cron: '0 12 * * *'
env:
NATRON_BUILD_WORKSPACE: 'D:/nbw'
CI: 'True'
jobs:
win-installer:
name: Windows Installer
runs-on: windows-2022
defaults:
run:
shell: msys2 {0}
outputs:
win_installer_artifact: ${{ steps.build.outputs.INSTALLER_NAME }}
steps:
- name: Checkout branch
uses: actions/checkout@v4.1.1
with:
submodules: recursive
- name: Install Windows system packages
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: git mingw-w64-x86_64-wget unzip diffutils
- name: Install Natron pacman repository
run: |
${GITHUB_WORKSPACE}/.github/workflows/install_natron_pacman_repo.sh ${GITHUB_WORKSPACE} ${GITHUB_WORKSPACE}/natron_pacman_repo
pacman -S --needed --noconfirm mingw-w64-x86_64-natron-build-deps-qt5
- name: Build
id: build
run: |
NATRON_BUILD_WORKSPACE_UNIX=$(cygpath -u ${NATRON_BUILD_WORKSPACE})
mkdir ${NATRON_BUILD_WORKSPACE_UNIX}
cd tools/jenkins
WORKSPACE=${NATRON_BUILD_WORKSPACE_UNIX} BUILD_NAME=natron BUILD_NUMBER=1 BITS=64 NATRON_LICENSE=GPL GIT_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git GIT_URL_IS_NATRON=1 SNAPSHOT_BRANCH=${GITHUB_REF_NAME} QT_VERSION_MAJOR=5 DISABLE_BREAKPAD=1 NOUPDATE=1 MKJOBS=$(nproc) MINIMIZE_DISK_USAGE=1 UNIT_TESTS=true ./launchBuildMain.sh
ARCHIVE_DIR=${NATRON_BUILD_WORKSPACE_UNIX}/builds_archive/natron/1
INSTALLER_ZIP_UNIX=$(ls ${ARCHIVE_DIR}/Natron*Windows-x86_64.zip)
# Unzip installer zip for artifact upload so we don't get a zipped zip file.
cd ${ARCHIVE_DIR}
INSTALLER_DIR="${ARCHIVE_DIR}/i"
INSTALLER_NAME=$(basename ${INSTALLER_ZIP_UNIX} .zip)
mkdir -p ${INSTALLER_DIR}
cd ${INSTALLER_DIR}
unzip ${INSTALLER_ZIP_UNIX}
echo "INSTALLER_NAME=${INSTALLER_NAME}" >> $GITHUB_OUTPUT
echo "INSTALLER_DIR=$(cygpath -m ${INSTALLER_DIR})" >> $GITHUB_OUTPUT
TEST_RESULTS_FILE="${ARCHIVE_DIR}/${INSTALLER_NAME}-tests.txt"
TEST_RESULTS_NAME="${INSTALLER_NAME}-tests"
echo "TEST_RESULTS_NAME=${TEST_RESULTS_NAME}" >> $GITHUB_OUTPUT
echo "TEST_RESULTS_FILE=$(cygpath -m ${TEST_RESULTS_FILE})" >> $GITHUB_OUTPUT
TEST_FAILURES_DIR="${ARCHIVE_DIR}/${INSTALLER_NAME}-unit_tests_failures"
TEST_FAILURES_NAME="${INSTALLER_NAME}-unit_tests_failures"
echo "TEST_FAILURES_NAME=${TEST_FAILURES_NAME}" >> $GITHUB_OUTPUT
echo "TEST_FAILURES_DIR=$(cygpath -m ${TEST_FAILURES_DIR})" >> $GITHUB_OUTPUT
- name: Build verify_plugin_loads binary
run: |
g++ -DWINDOWS -o verify_plugin_loads .github/workflows/verify_plugin_loads.cpp libs/OpenFX/HostSupport/src/ofxhBinary.cpp libs/OpenFX/HostSupport/src/ofxhUtilities.cpp -I libs/OpenFX/HostSupport/include/ -I libs/OpenFX/include/
- name: Uninstall Natron dependencies
run: |
pacman -Rs --noconfirm mingw-w64-x86_64-natron-build-deps-qt5
- name: Upload installer
uses: actions/upload-artifact@v4.3.1
with:
name: ${{ steps.build.outputs.INSTALLER_NAME }}
path: ${{ steps.build.outputs.INSTALLER_DIR }}
- name: Upload test results
uses: actions/upload-artifact@v4.3.1
with:
name: ${{ steps.build.outputs.TEST_RESULTS_NAME }}
path: ${{ steps.build.outputs.TEST_RESULTS_FILE }}
- name: Upload test failures
uses: actions/upload-artifact@v4.3.1
with:
name: ${{ steps.build.outputs.TEST_FAILURES_NAME }}
path: ${{ steps.build.outputs.TEST_FAILURES_DIR }}
- name: Verify plugin loading
run: |
INSTALLER_DIR=$(cygpath -u '${{ steps.build.outputs.INSTALLER_DIR }}')/${{ steps.build.outputs.INSTALLER_NAME }}
for x in $(find ${INSTALLER_DIR}/Plugins -name *.ofx); do
echo "Testing $(basename ${x}) ..."
PATH=${INSTALLER_DIR}/bin ./verify_plugin_loads.exe "${x}"
done
- name: Verify passing tests match 2.5.0 release
run: |
wget https://github.com/NatronGitHub/Natron/releases/download/v2.5.0/Natron-2.5.0-Windows-x86_64-tests.txt
if diff Natron-2.5.0-Windows-x86_64-tests.txt ${{ steps.build.outputs.TEST_RESULTS_FILE }}; then
echo "Test results match 2.5.0 release : PASS"
else
echo "Test results match 2.5.0 release : FAILED"
exit 1
fi
win-installer-breakpad:
name: Windows Installer (with Breakpad crash reporting)
runs-on: windows-2022
defaults:
run:
shell: msys2 {0}
outputs:
win_installer_breakpad_artifact: ${{ steps.build.outputs.INSTALLER_NAME }}
win_installer_breakpad_symbols_artifact: ${{ steps.build.outputs.SYMBOLS_NAME }}
steps:
- name: Checkout branch
uses: actions/checkout@v4.1.1
with:
submodules: recursive
- name: Install Windows system packages
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: git mingw-w64-x86_64-wget unzip
- name: Install Natron pacman repository
run: |
${GITHUB_WORKSPACE}/.github/workflows/install_natron_pacman_repo.sh ${GITHUB_WORKSPACE} ${GITHUB_WORKSPACE}/natron_pacman_repo
pacman -S --needed --noconfirm mingw-w64-x86_64-natron-build-deps-qt5
- name: Build
id: build
run: |
NATRON_BUILD_WORKSPACE_UNIX=$(cygpath -u ${NATRON_BUILD_WORKSPACE})
mkdir ${NATRON_BUILD_WORKSPACE_UNIX}
cd tools/jenkins
WORKSPACE=${NATRON_BUILD_WORKSPACE_UNIX} BUILD_NAME=natron BUILD_NUMBER=1 BITS=64 NATRON_LICENSE=GPL GIT_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git GIT_URL_IS_NATRON=1 SNAPSHOT_BRANCH=${GITHUB_REF_NAME} QT_VERSION_MAJOR=5 NOUPDATE=1 MKJOBS=$(nproc) MINIMIZE_DISK_USAGE=1 ./launchBuildMain.sh
ARCHIVE_DIR=${NATRON_BUILD_WORKSPACE_UNIX}/builds_archive/natron/1
INSTALLER_ZIP_UNIX=$(ls ${ARCHIVE_DIR}/Natron*-breakpad.zip)
set -x
# Unzip installer zip for artifact upload so we don't get a zipped zip file.
cd ${ARCHIVE_DIR}
INSTALLER_DIR="${ARCHIVE_DIR}/i"
INSTALLER_NAME=$(basename ${INSTALLER_ZIP_UNIX} .zip)
mkdir -p ${INSTALLER_DIR}
cd ${INSTALLER_DIR}
unzip ${INSTALLER_ZIP_UNIX}
echo "INSTALLER_NAME=${INSTALLER_NAME}" >> $GITHUB_OUTPUT
echo "INSTALLER_DIR=$(cygpath -m ${INSTALLER_DIR})" >> $GITHUB_OUTPUT
SYMBOLS_NAME="${INSTALLER_NAME}-symbols"
SYMBOLS_DIR="${ARCHIVE_DIR}/s"
cd ${ARCHIVE_DIR}
mv symbols ${SYMBOLS_NAME}
mkdir ${SYMBOLS_DIR}
mv ${SYMBOLS_NAME} ${SYMBOLS_DIR}
echo "SYMBOLS_NAME=${SYMBOLS_NAME}" >> $GITHUB_OUTPUT
echo "SYMBOLS_DIR=$(cygpath -m ${SYMBOLS_DIR})" >> $GITHUB_OUTPUT
- name: Build verify_plugin_loads binary
run: |
g++ -DWINDOWS -o verify_plugin_loads .github/workflows/verify_plugin_loads.cpp libs/OpenFX/HostSupport/src/ofxhBinary.cpp libs/OpenFX/HostSupport/src/ofxhUtilities.cpp -I libs/OpenFX/HostSupport/include/ -I libs/OpenFX/include/
- name: Uninstall Natron dependencies
run: |
pacman -Rs --noconfirm mingw-w64-x86_64-natron-build-deps-qt5
- name: Upload installer
uses: actions/upload-artifact@v4.3.1
with:
name: ${{ steps.build.outputs.INSTALLER_NAME }}
path: ${{ steps.build.outputs.INSTALLER_DIR }}
- name: Upload symbols
uses: actions/upload-artifact@v4.3.1
with:
name: ${{ steps.build.outputs.SYMBOLS_NAME }}
path: ${{ steps.build.outputs.SYMBOLS_DIR }}
- name: Verify plugin loading
run: |
INSTALLER_DIR=$(cygpath -u '${{ steps.build.outputs.INSTALLER_DIR }}')/${{ steps.build.outputs.INSTALLER_NAME }}
for x in $(find ${INSTALLER_DIR}/Plugins -name *.ofx); do
echo "Testing $(basename ${x}) ..."
PATH=${INSTALLER_DIR}/bin ./verify_plugin_loads.exe "${x}"
done
update-nightly-release:
name: "Update Nightly Release"
runs-on: "ubuntu-latest"
needs: [win-installer, win-installer-breakpad]
permissions:
contents: write
if: (github.event.schedule != '' && github.ref_name == 'AJC-RB-2.5') || ${{ inputs.push_to_nightly_release }}
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R artifacts
- name: Zip artifacts
run: |
cd artifacts
(cd ${{ needs.win-installer.outputs.win_installer_artifact }}; zip -r ../${{ needs.win-installer.outputs.win_installer_artifact }}.zip *)
(cd ${{ needs.win-installer-breakpad.outputs.win_installer_breakpad_artifact }}; zip -r ../${{ needs.win-installer-breakpad.outputs.win_installer_breakpad_artifact }}.zip *)
(cd ${{ needs.win-installer-breakpad.outputs.win_installer_breakpad_symbols_artifact }}; zip -r ../${{ needs.win-installer-breakpad.outputs.win_installer_breakpad_symbols_artifact }}.zip *)
- name: Display structure of downloaded files
run: ls -R artifacts
- uses: "softprops/action-gh-release@v1"
with:
token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
tag_name: nightly
target_commitish: ${{ github.sha }}
files: |
artifacts/*.zip