-
-
Notifications
You must be signed in to change notification settings - Fork 10
226 lines (214 loc) · 7.97 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
221
222
223
224
225
226
name: CI
on:
push:
branches: [ master ]
tags:
- 'v*'
pull_request:
branches: [ master ]
env:
QtVersion: 6.6.3
QtTools: 'tools_ifw'
QtKey: "6.6.3-ifw46"
BuildType: RelWithDebInfo
cmakeConfigure: "cmake -S. -Bbuild -DDEMOS=ON -DQT_DEFAULT_MAJOR_VERSION=6 -DCMAKE_BUILD_TYPE=RelWithDebInfo -G Ninja -DSBOM_LINT=ON"
debianRequirments: "build-essential git zlib1g-dev cmake doxygen graphviz qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools qt6-declarative-dev qt6-base-dev libqt6svg6-dev qt6-base-dev-tools qt6-translations-l10n libqt6core5compat6-dev libgl1-mesa-dev rename devscripts ninja-build clang"
jobs:
precheck:
name: Job Info
runs-on: ubuntu-latest
outputs:
version: ${{ steps.checkbuild.outputs.version }}
steps:
- name: Run Info
id: checkbuild
run: |
if [[ "$GITHUB_REF" == *"tags/v"* ]]; then
VER="$GITHUB_REF_NAME"
else
VER="continuous"
fi
echo "version=$VER" >> $GITHUB_OUTPUT
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v4
with:
args: spdx
deb_builder:
name: debianBuilder-${{matrix.config.name}}-${{matrix.config.debArch}}
runs-on: ${{matrix.config.os}}
needs: precheck
strategy:
fail-fast: false
matrix:
config:
- name: jammy
os: ubuntu-22.04
debArch: amd64
- name: jammy
os: ubuntu-22.04-arm
debArch: arm64
- name: noble
os: ubuntu-24.04
debArch: amd64
- name: noble
os: ubuntu-24.04-arm
debArch: arm64
steps:
- uses: sithlord48/[email protected]
- name: Install Dependencies
run: |
sudo apt-get update -y > /dev/null
sudo apt-get upgrade -y > /dev/null
sudo apt-get install -qqq ${{env.debianRequirments}} > /dev/null
sudo apt search qt | grep installed
pip install --user ntia-conformance-checker
pip install --user spdx-tools
- name: Build
run: |
${{env.cmakeConfigure}} -DCMAKE_INSTALL_PREFIX=/usr -DPACKAGE_VERSION_LABEL="${{ needs.precheck.outputs.version }}" -DCPACK_DEBIAN_PACKAGE_RELEASE=${{github.run_attempt}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake --build build --target package
mv build/ff7tk[-_]*.* .
mv build/libff7tk[-_]*.deb .
- name: Upload
uses: actions/upload-artifact@v4
with:
name: debian-artifacts-${{matrix.config.name}}-${{matrix.config.debArch}}
path: |
ff7tk[-_]*.*
libff7tk*.deb
main_build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
needs: precheck
strategy:
fail-fast: false
matrix:
config:
- {
name: "Linux-x86_64"
, os: ubuntu-20.04
, QT_INST_DIR: /opt, Qt_TOOL_PATH: "/opt/Qt/Tools/QtInstallerFramework/4.6"
, extraCmakeConfig: "-DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
}
- {
name: "MacOS"
, os: macos-latest
, QT_INST_DIR: /Users/runner, Qt_TOOL_PATH: "/Users/runner/Qt/Tools/QtInstallerFramework/4.6"
, extraCmakeConfig: "-DCMAKE_OSX_ARCHITECTURES=\"arm64;x86_64\""
}
- {
name: "Windows-x64"
, os: windows-2019
, QT_INST_DIR: "C:", Qt_TOOL_PATH: "C:/Qt/Tools/QtInstallerFramework/4.6"
, extraCmakeConfig: "-DZLIB_ROOT=C:/zlib"
}
steps:
- uses: sithlord48/[email protected]
- run: git fetch --tags --force
- name: Cache Zlib
id: cache-zlib
if: runner.os == 'Windows'
uses: actions/cache@v4
with:
path: C:/zlib
key: ${{ runner.os }}${{ matrix.config.WIN_ARCH }}-zlib-1.3
- name: Cache Chocolatey
id: cache-choco
if: (runner.os == 'Windows')
uses: actions/cache@v4
with:
path: |
C:/ProgramData/chocolatey/bin/
C:/ProgramData/chocolatey/lib/ninja
C:/ProgramData/chocolatey/lib/doxygen.install
C:/ProgramData/chocolatey/lib/Graphviz
C:/Program*/doxygen/
C:/Program*/Graphviz/
key: cache-chocolatey${{ matrix.config.WIN_ARCH }}-zlib-1-3
- name: Setup MSVC Shell For Windows
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Install Dependencies
if: ((runner.os == 'Windows') && (steps.cache-choco.outputs.cache-hit != 'true')) || (runner.os != 'Windows')
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update > /dev/null && sudo apt-get install -qqq doxygen graphviz devscripts libxkbcommon-x11-0 ninja-build clang > /dev/null
elif [ "$RUNNER_OS" == "Windows" ]; then
choco install ninja doxygen.install graphviz
else
brew install doxygen graphviz ninja
fi
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
dir: ${{matrix.config.QT_INST_DIR}}
version: ${{ env.QtVersion }}
modules: qt5compat
cache: true
cache-key-prefix: ${{runner.os}}-${{env.WIN_ARCH}}-${{env.QtKey}}
tools: ${{env.QtTools}}
- name: Build Zlib For Windows
if: (runner.os == 'Windows') && (steps.cache-zlib.outputs.cache-hit != 'true')
run: |
git clone -q --branch=v1.3 https://github.com/madler/zlib ${{github.workspace}}\zlib-git
cmake -S${{github.workspace}}\zlib-git -B${{github.workspace}}\zlib-git\build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:/zlib
cmake --build ${{github.workspace}}\zlib-git\build --config Release
cmake --install ${{github.workspace}}\zlib-git\build --strip
- name: Update Windows Paths
if: (runner.os == 'Windows')
run: |
echo "C:\zlib\bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Program Files\doxygen\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Program Files\Graphviz\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Python312" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install SPDX Tooling
shell: bash
run: |
pip install --user ntia-conformance-checker
pip install --user spdx-tools
pip install --user reuse
- name: Build ff7tk
run: |
${{env.cmakeConfigure}} -DPACKAGE_VERSION_LABEL="${{ needs.precheck.outputs.version }}" -DCPACK_IFW_ROOT=${{matrix.config.Qt_TOOL_PATH}} ${{matrix.config.extraCmakeConfig}}
cmake --build build --config ${{env.BuildType}} --target package
- name: Update Documentation
if: runner.os == 'Linux' && github.ref == 'refs/heads/master'
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: build/docs/html
- name: Upload
uses: actions/upload-artifact@v4
with:
name: artifact-${{matrix.config.name}}
path: |
${{ github.workspace }}/build/ff7tk[-_]*.*
${{ github.workspace }}/build/libff7tk[-_]*.*
release_assets:
name: Release
needs: [main_build, deb_builder]
runs-on: ubuntu-latest
steps:
- name: Download Files
uses: actions/download-artifact@v4
- name: Deploy Continuous
if: (github.ref == 'refs/heads/master') && !(contains(github.ref, '/tags/v'))
uses: crowbarmaster/GH-Automatic-Releases@latest
with:
repo_token: "${{ secrets.DEPLOYTOKEN }}"
automatic_release_tag: "continuous"
prerelease: false
title: "Continuous Build"
files: |
artifact-*/*
debian-artifacts-*/*
- name: Deploy Release
if: contains(github.ref, '/tags/v')
uses: crowbarmaster/GH-Automatic-Releases@latest
with:
repo_token: "${{ secrets.DEPLOYTOKEN }}"
prerelease: false
files: |
artifact-*/*
debian-artifacts-*/*