-
Notifications
You must be signed in to change notification settings - Fork 4
234 lines (227 loc) · 7.59 KB
/
docker.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
---
name: docker
# Run on push and once a week to keep the images from bitrotting and to
# identify issues while no commits are being pushed.
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: "52 2 * * 0"
# Cancel old PR builds when pushing new commits.
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
image:
- alpine-s390x
- bazel
- compcert
- doxygen
- flutter-web
- frama-c
- freebsd
- haskell
- pkgsrc
include:
- image: bazel
has_base: true
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Build base image
if: ${{ matrix.has_base }}
run: |
cd ${{ matrix.image }} && ./build.sh
- name: Build and push (with base image)
if: ${{ matrix.has_base }}
uses: docker/build-push-action@v6
with:
context: "${{ matrix.image }}"
build-contexts: "base=oci-layout://${{ matrix.image }}/layers:base"
tags: toxchat/${{ matrix.image }}:latest
cache-from: type=registry,ref=toxchat/${{ matrix.image }}:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}
- name: Build and push
if: ${{ !matrix.has_base }}
uses: docker/build-push-action@v6
with:
context: "${{ matrix.image }}"
tags: toxchat/${{ matrix.image }}:latest
cache-from: type=registry,ref=toxchat/${{ matrix.image }}:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}
buildfarm:
strategy:
matrix:
image: [server, worker]
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:buildfarm"
file: ${{ matrix.image }}.Dockerfile
tags: toxchat/buildfarm-${{ matrix.image }}:latest
cache-from: type=registry,ref=toxchat/buildfarm-${{ matrix.image }}:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}
qtox-host-qt:
strategy:
fail-fast: true
matrix:
version: [6.2.4, 6.8.1]
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:qtox"
file: "docker/Dockerfile.host-qt"
build-args: |
QT_VERSION=${{ matrix.version }}
tags: toxchat/qtox:host-qt_${{ matrix.version }}
cache-from: type=registry,ref=toxchat/qtox:host-qt_${{ matrix.version }}
cache-to: type=inline
push: ${{ github.event_name == 'push' }}
qtox:
# Only windows needs it, but this dependency doesn't harm much, as host-qt
# doesn't get changed often.
needs: [qtox-host-qt]
strategy:
fail-fast: false
matrix:
image:
- alpine
- alpine-appimage
- alpine-static
- debian
- fedora
- flatpak-builder
- ubuntu-lts
- windows-builder.i686
- windows-builder.x86_64
include:
- image: windows-builder.i686
file: windows-builder
args: |
ARCH=i686
WINEARCH=win32
- image: windows-builder.x86_64
file: windows-builder
args: |
ARCH=x86_64
WINEARCH=win64
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:qtox"
file: "docker/Dockerfile.${{ matrix.file || matrix.image }}"
build-args: ${{ matrix.args }}
tags: toxchat/qtox:${{ matrix.image }}
cache-from: type=registry,ref=toxchat/qtox:${{ matrix.image }}
cache-to: type=inline
push: ${{ github.event_name == 'push' }}
qtox-android:
needs: [qtox-host-qt]
strategy:
fail-fast: true
matrix:
arch: [armeabi-v7a, arm64-v8a]
build_type: [debug, release]
version: [6.2.4, 6.8.1]
include:
- version: 6.2.4
ndk_version: 21.3.6528147
android_api: 24
- version: 6.8.1
ndk_version: 26.1.10909125
android_api: 26
- arch: armeabi-v7a
abi_args: |
ANDROID_ABI=armeabi-v7a
ANDROID_FFMPEG_ABI=armv7a
ANDROID_OPENSSL_ABI=arm
ANDROID_OPENSSL_ASM=-no-asm
ANDROID_TRIPLE=armv7a-linux-androideabi
ANDROID_VPX_ABI=armv7-android-gcc
- arch: arm64-v8a
abi_args: |
ANDROID_ABI=arm64-v8a
ANDROID_FFMPEG_ABI=arm64
ANDROID_OPENSSL_ABI=arm64
ANDROID_OPENSSL_ASM=
ANDROID_TRIPLE=aarch64-linux-android
ANDROID_VPX_ABI=arm64-android-gcc
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:qtox"
file: "docker/Dockerfile.android-builder"
build-args: |
${{ matrix.abi_args }}
ANDROID_API=${{ matrix.android_api }}
NDK_VERSION=${{ matrix.ndk_version }}
QT_BUILD_TYPE=${{ matrix.build_type }}
QT_VERSION=${{ matrix.version }}
tags: toxchat/qtox:android-builder.${{ matrix.arch }}.${{ matrix.build_type }}_${{ matrix.version }}
cache-from: type=registry,ref=toxchat/qtox:android-builder.${{ matrix.arch }}.${{ matrix.build_type }}_${{ matrix.version }}
cache-to: type=inline
push: ${{ github.event_name == 'push' }}