-
Notifications
You must be signed in to change notification settings - Fork 635
180 lines (157 loc) · 5.72 KB
/
build_qmlls.yaml
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
name: Build qmlls
on:
# release nightly on schedule
schedule:
- cron: '0 2 * * 1,3,5'
# also release nightly on manual trigger
workflow_dispatch:
# release "real" release when a qmlls tag is pushed to dev
push:
branches:
- 'dev'
tags:
- 'qmlls-*'
defaults:
run:
shell: bash
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- name: ubuntu
os: ubuntu-latest
deps: libgl-dev libglu-dev 'libxcb*-dev' libx11-xcb-dev libxkbcommon-x11-dev libb2-dev libdouble-conversion-dev
tools: ccache
install_cmd: sudo apt-get -y install
configure_flags: -xcb
- name: macos
os: macos-latest
deps:
tools: ccache
install_cmd: HOMEBREW_NO_INSTALL_CLEANUP=1 brew install
- name: windows
os: windows-latest
install_cmd: choco install
install_cmd_postfix: --yes --no-progress
tools: ccache
configure_flags: -no-feature-sql-psql -no-feature-sql-mysql -no-feature-sql-odbc
runs-on: ${{ matrix.os }}
steps:
- uses: lukka/get-cmake@latest
- name: prepare Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
- name: prepare macOS
if: runner.os == 'macOS'
run: echo noop
- name: prepare Windows
if: runner.os == 'Windows'
shell: cmd
run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
set >> "%GITHUB_ENV%"
- uses: actions/checkout@v4
with:
path: source
- name: restore ccache
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/ccache
key: ccache-${{ matrix.os }}
- name: install build dependencies
run: ${{ matrix.install_cmd }} ${{ matrix.deps }} ${{ matrix.install_cmd_postfix }}
if: matrix.deps != ''
- name: install compiler tools
run: ${{ matrix.install_cmd }} ${{ matrix.tools }} ${{ matrix.install_cmd_postfix }}
- name: configure ccache
run: |
ccache --set-config sloppiness=file_macro,time_macros
ccache --set-config cache_dir='${{ runner.temp }}'/ccache
ccache --set-config compression=true
ccache --set-config max_size=1G
- name: initialize subrepositories
working-directory: source
run: ./init-repository --module-subset=qtdeclarative --mirror="https://code.qt.io/qt/"
- name: set qtdeclarative to dev and set dependencies via dependencies.yaml
working-directory: source
run: cmake -DSYNC_TO_MODULE="qtdeclarative" -DSYNC_TO_BRANCH="dev" -P cmake/QtSynchronizeRepo.cmake
- name: configure and build
run: |
mkdir build
cd build
../source/configure -force-debug-info -ccache -no-pch -release -static \
-force-bundled-libs -submodules qtdeclarative -nomake tests -nomake examples \
-prefix '${{ runner.temp }}'/install_dir ${{ matrix.configure_flags }}
ninja qmlls
- name: Get current SHA
id: vars
working-directory: source/qtdeclarative
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Create info file
run: |
echo -e "commit: ${{ steps.vars.outputs.sha_short }}\nbuild: $(date +"%Y-%m-%dT%H:%M:%SZ")" \
> info.txt
# workaround because -separate-debug-info is not supported in static builds
# note: msvc on windows separates the debug info, no need to strip by hand
- name: Stripping qmlls binary on linux
if: matrix.name == 'ubuntu'
run: |
objcopy --only-keep-debug ./build/qtbase/bin/qmlls ./build/qtbase/bin/qmlls.dbg
strip ./build/qtbase/bin/qmlls
objcopy --add-gnu-debuglink=./build/qtbase/bin/qmlls.dbg ./build/qtbase/bin/qmlls
- name: Stripping qmlls binary on mac
if: matrix.name == 'macos'
run: |
dsymutil ./build/qtbase/bin/qmlls -o ./build/qtbase/bin/qmlls.dSYM
strip ./build/qtbase/bin/qmlls
- name: Zip build files in archive
run: 7z a qmlls-${{ matrix.name }}-${{ steps.vars.outputs.sha_short }}.7z ./build/qtbase/bin/qmlls* info.txt
- name: Upload archive
uses: actions/upload-artifact@v4
with:
path: qmlls-${{ matrix.name }}-${{ steps.vars.outputs.sha_short }}.7z
name: qmlls-${{ matrix.name }}-${{ steps.vars.outputs.sha_short }}.7z
release:
permissions:
contents: write
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
repository: qt/qtdeclarative
path: source
- name: Get current SHA
id: vars
working-directory: source
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Download artifacts
id: downloaded_artifacts
uses: actions/download-artifact@v4
with:
path: release
- name: Create nightly release
if: ${{ ! contains(github.ref, 'tags/qmlls-') }}
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: qmlls-nightly-${{ steps.vars.outputs.sha_short }}
draft: false
prerelease: true
files: release/*/*.7z
- name: Create release
if: ${{ contains(github.ref, 'tags/qmlls-') && !contains(github.ref, 'nightly') }}
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# note: use default tag_name
draft: true
prerelease: false
files: release/*/*.7z