forked from qbs/qbs
-
Notifications
You must be signed in to change notification settings - Fork 0
242 lines (236 loc) · 8.46 KB
/
release.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
name: Build release packages
on:
push:
branches-ignore:
- 'gerrit/*'
tags:
- 'v*'
jobs:
build-linux:
name: ${{ matrix.config.name }}
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
config:
- {
name: 'Build on Linux (gcc)',
options: 'qbs.installPrefix:""
modules.cpp.compilerWrapper:ccache
modules.qbsbuildconfig.enableAddressSanitizer:false
project.withTests:false
modules.qbsbuildconfig.enableUnitTests:false
modules.qbsbuildconfig.enableBundledQt:true
products.qbs_archive.targetName:qbs-linux-${{ github.run_id }}',
script: './scripts/build-qbs-with-qbs.sh',
cacheid: 'gcc-release',
}
env:
BUILD_OPTIONS: ${{ matrix.config.options }}
WITH_TESTS: 0
steps:
- uses: actions/checkout@v1
- name: Create .ccache dir
run: mkdir -p ~/.ccache
- name: prepare timestamp
id: get-timestamp
run: echo "timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
shell: bash
- name: ccache cache files
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache
- name: Pull the Docker Image
run: docker compose pull jammy-qt6
- name: Print ccache stats
run: docker compose run jammy-qt6 ccache -s
- name: Build Qbs
run: docker compose run jammy-qt6 ${{ matrix.config.script }}
- name: Print ccache stats
run: docker compose run jammy-qt6 ccache -s
- name: Get archive name
id: get-archive-name
run: echo "archive-name=$(git describe)" >> $GITHUB_OUTPUT
- name: Upload artifacts
uses: 'actions/upload-artifact@v4'
with:
name: qbs-linux-${{ github.run_id }}.tar.gz
path: release/qbs-linux-${{ github.run_id }}.tar.gz
build-macos:
name: Build on macOS
runs-on: macos-12
timeout-minutes: 60
env:
BUILD_OPTIONS: |
qbs.installPrefix:""
modules.cpp.compilerWrapper:ccache
project.withTests:false
modules.qbsbuildconfig.enableUnitTests:false
modules.qbsbuildconfig.enableAddressSanitizer:false
modules.qbsbuildconfig.enableBundledQt:true
products.qbs_archive.targetName:qbs-macos-${{ github.run_id }}
WITH_TESTS: 0
steps:
- uses: actions/checkout@v1
- name: Create .ccache dir
run: mkdir -p ~/.ccache
- name: prepare timestamp
id: get-timestamp
run: echo "timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
shell: bash
- name: ccache cache files
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ runner.os }}-release-ccache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: ${{ runner.os }}-release-ccache
- name: Install required packages
run: |
brew install ccache p7zip
python3 -m pip install --user beautifulsoup4 lxml
- name: Install Qt
uses: ./.github/actions/download-qt
with:
toolchain: clang_64
- name: Install Qt Creator
uses: ./.github/actions/download-qtc
- name: Setup Qbs
run: |
qbs setup-toolchains --detect
qbs setup-qt --detect
qbs config profiles.qt.baseProfile xcode_13_2_1-macosx-x86_64
qbs config defaultProfile qt
qbs config --list
- name: Print ccache stats
run: ccache -s
- name: Build Qbs
run: scripts/build-qbs-with-qbs.sh
- name: Print ccache stats
run: ccache -s
- name: Upload artifacts
uses: 'actions/upload-artifact@v4'
with:
name: qbs-macos-${{ github.run_id }}.tar.gz
path: release/qbs-macos-${{ github.run_id }}.tar.gz
build-windows-with-docker:
name: Build on Windows (Docker)
runs-on: windows-2019
timeout-minutes: 60
env:
WITH_TESTS: 0
QT_ASSUME_STDERR_HAS_CONSOLE: 1
CLCACHE_DIR: C:\.ccache
steps:
- uses: actions/checkout@v1
- name: Create .ccache dir
run: mkdir -p ~/.ccache
shell: bash
- name: prepare timestamp
id: get-timestamp
run: echo "timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
shell: bash
- name: clcache cache files
uses: actions/cache@v4
with:
path: ~/clcache
key: ${{ runner.os }}-release-msvc-docker-clcache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: ${{ runner.os }}-release-msvc-docker-clcache
- name: Pull the Windows Image
run: docker compose pull windows
- name: Print clcache stats
run: docker compose run --rm windows clcache -s
- name: Build Qbs
run: >
docker compose run --rm windows qbs build
-p dist
qbs.buildVariant:release
modules.cpp.compilerWrapper:clcache
project.withTests:false
modules.qbsbuildconfig.enableBundledQt:true
modules.qbsbuildconfig.enableUnitTests:false
modules.cpp.treatWarningsAsErrors:true
project.withDocumentation:true
config:release profile:qt64
- name: Print clcache stats
run: docker compose run --rm windows clcache -s
- name: Get archive name
id: get-archive-name
run: echo "archive-name=$(git describe)" >> $GITHUB_OUTPUT
- name: Upload artifacts
uses: 'actions/upload-artifact@v4'
with:
name: qbs-windows-${{ github.run_id }}
path: |
release/qbs.*.nupkg
release/qbs-windows-*.zip
create-archives:
name: Create Archives
runs-on: ubuntu-latest
needs: [build-linux, build-windows-with-docker]
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Get version name
id: get-version-name
run: echo "version-name=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Create directories
run: |
mkdir release
mkdir tmp
- name: Copy sources
run: rsync -av --exclude='.git/' --exclude='tmp/' . ./tmp/qbs-src-${{ steps.get-version-name.outputs.version-name }}
- name: Zip Archive
run: |
cd tmp/
zip -r ../release/qbs-src-${{ steps.get-version-name.outputs.version-name }}.zip qbs-src-${{ steps.get-version-name.outputs.version-name }}
- name: Tarball Archive
run: |
cd tmp/
tar czf ../release/qbs-src-${{ steps.get-version-name.outputs.version-name }}.tar.gz qbs-src-${{ steps.get-version-name.outputs.version-name }}
- name: Download Linux artifacts
uses: actions/download-artifact@v4
with:
name: qbs-linux-${{ github.run_id }}.tar.gz
path: ./tmp
- name: Repack Linux artifact
run: |
mkdir -p tmp/qbs-linux-x86_64-${{ steps.get-version-name.outputs.version-name }}
tar xzf ./tmp/qbs-linux-${{ github.run_id }}.tar.gz -C tmp/qbs-linux-x86_64-${{ steps.get-version-name.outputs.version-name }}
cd tmp/
tar czf ../release/qbs-linux-x86_64-${{ steps.get-version-name.outputs.version-name }}.tar.gz qbs-linux-x86_64-${{ steps.get-version-name.outputs.version-name }}
- name: Download Windows artifacts
uses: actions/download-artifact@v4
with:
name: qbs-windows-${{ github.run_id }}
path: ./tmp/release
- name: Copy Windows artifacts
run: |
cp ./tmp/release/qbs.*.nupkg ./release
cp ./tmp/release/qbs-windows-x86_64-*.zip ./release
- name: Copy changelog
run: cp changelogs/changes-${{ steps.get-version-name.outputs.version-name }}.md release || echo "changelog not found"
- name: Generate checksums
run: |
cd release/
find . -type f -printf '%f\n' | grep -v .txt | xargs md5sum > md5sums.txt
find . -type f -printf '%f\n' | grep -v .txt | xargs sha256sum > sha256sums.txt
- name: Get archive name
id: get-archive-name
run: echo "archive-name=$(git describe)" >> $GITHUB_OUTPUT
- name: Upload artifacts
uses: 'actions/upload-artifact@v4'
with:
name: qbs-release-${{ steps.get-archive-name.outputs.archive-name }}
path: |
release/qbs-src-*.zip
release/qbs-src-*.tar.gz
release/qbs-linux-*.tar.gz
release/qbs.*.nupkg
release/qbs-windows-x86_64-*.zip
release/changes-*.md
release/md5sums.txt
release/sha256sums.txt