-
Notifications
You must be signed in to change notification settings - Fork 8
185 lines (149 loc) · 4.86 KB
/
build.yml
File metadata and controls
185 lines (149 loc) · 4.86 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
name: Build libdither
env:
QT_VERSION_WIN: "6.9.2"
on:
workflow_dispatch:
push:
tags:
- '*-*-*'
permissions:
contents: write
jobs:
build:
name: Build (${{ matrix.project }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
project: win64_msvc
- os: windows-latest
project: win64_mingw
- os: ubuntu-22.04
project: linux_x86_64
- os: macos-latest
project: macos_universal
qt_arch: clang_64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up msbuild (Windows MSVC)
if: matrix.project == 'win64_msvc'
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- name: Build libdither (Windows MSVC)
if: matrix.project == 'win64_msvc'
run: |
msbuild libdither.vcxproj /p:Configuration=Release /property:Platform=x64
shell: cmd
- name: Build demo (Windows MSVC)
if: matrix.project == 'win64_msvc'
run: |
msbuild libdither_static.vcxproj /p:Configuration=Release /property:Platform=x64
msbuild demo.vcxproj /p:Configuration=Release /property:Platform=x64
shell: cmd
- name: Run demo (Windows MSVC)
if: matrix.project == 'win64_msvc'
run: |
make demo_run_msvc
shell: cmd
- name: Set up Make and Chocolatey (Windows MinGW)
if: matrix.project == 'win64_mingw'
uses: crazy-max/ghaction-chocolatey@v3
with:
args: 'install make'
- name: Set up Qt (Windows MinGW)
if: matrix.project == 'win64_mingw'
uses: jurplel/install-qt-action@v4
with:
target: 'desktop'
arch: ${{ matrix.qt_arch }}
version: ${{ env.QT_VERSION_WIN }}
archives: 'qtbase MinGW'
setup-python: true
cache: true
add-tools-to-path: true
set-env: true
- name: Build libdither (Windows MinGW)
if: matrix.project == 'win64_mingw'
run: |
make WIN_MINGW_BIN_PATH=%GITHUB_WORKSPACE%\Qt\${{ env.QT_VERSION_WIN }}\mingw_64\bin libdither
shell: cmd
- name: Build demo (Windows MinGW)
if: matrix.project == 'win64_mingw'
run: |
make WIN_MINGW_BIN_PATH=%GITHUB_WORKSPACE%\Qt\${{ env.QT_VERSION_WIN }}\mingw_64\bin demo
shell: cmd
- name: Run demo (Windows MinGW)
if: matrix.project == 'win64_mingw'
run: |
make demo_run
shell: cmd
- name: Install prerequisites (Linux)
if: matrix.project == 'linux_x86_64'
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- name: Build libdither (Linux)
if: matrix.project == 'linux_x86_64'
run: |
make libdither
shell: bash -l {0}
- name: Build demo (Linux)
if: matrix.project == 'linux_x86_64'
run: |
make demo
shell: bash -l {0}
- name: Run demo (Linux)
if: matrix.project == 'linux_x86_64'
run: |
make demo_run
shell: bash -l {0}
- name: Build libdither (macOS)
if: matrix.project == 'macos_universal'
run: |
make libdither_universal
shell: bash
- name: Build demo (macOS)
if: matrix.project == 'macos_universal'
run: |
make demo
shell: bash
- name: Run demo (macOS)
if: matrix.project == 'macos_universal'
run: |
make demo_run
shell: bash
- name: Cleanup (Windows MSVC)
if: matrix.project == 'win64_msvc'
run: |
ls -la $GITHUB_WORKSPACE/dist/Release
rm dist/Release/*.bmp
rm dist/Release/*.png
rm dist/Release/demo.*
shell: bash
- name: Cleanup (General)
if: matrix.project != 'win64_msvc'
run: |
ls -la $GITHUB_WORKSPACE/dist
rm dist/*.bmp
rm dist/*.png
rm dist/demo*
shell: bash
- name: Package artifacts
id: pkg
run: |
ls -la $GITHUB_WORKSPACE/dist
echo "dist_path=$GITHUB_WORKSPACE/dist" >> $GITHUB_OUTPUT
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ditherista-${{ matrix.project }}
path: ${{ steps.pkg.outputs.dist_path }}
if-no-files-found: warn
retention-days: 14