Skip to content

Commit dbbf7fa

Browse files
author
Alexander B
committed
add github-action for comiling and building deb/rpm
1 parent e1c222b commit dbbf7fa

File tree

1 file changed

+302
-0
lines changed

1 file changed

+302
-0
lines changed

.github/workflows/action-cpp.yml

Lines changed: 302 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
1+
name: build and cpack
2+
on: [ push, pull_request ]
3+
jobs:
4+
ubuntu-22-04:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
#
8+
# matrix for containers
9+
#
10+
matrix:
11+
container:
12+
- ubuntu:22.04
13+
14+
container:
15+
image: ${{ matrix.container }}
16+
17+
steps:
18+
- name: Get current date
19+
id: date
20+
run: echo "date=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
21+
- name: Get commit sha
22+
id: git_sha
23+
run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
24+
- uses: actions/checkout@v3
25+
# install dependencies
26+
- name: devel-pkgs
27+
run: |
28+
apt-get update -y && apt-get install -yq binutils python3-nautilus make cmake qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gcc g++
29+
# build project
30+
- name: mkdir
31+
run: ls -l && mkdir cmake-build-release
32+
- name: cmake cmake-build-release
33+
run: cmake -DCOMMITTER_DATE="${{ steps.date.outputs.date }}" -DCOMMITTER_FULLSHA="${{ steps.git_sha.outputs.git_sha }}" -DCOMMITTER_SHORTSHA="$(echo ${{ steps.git_sha.outputs.git_sha }} | cut -c1-7)" -DCMAKE_BUILD_TYPE=Release -Bcmake-build-release -H.
34+
- name: cmake make
35+
run: cmake --build cmake-build-release/ --target all
36+
env:
37+
MAKEFLAGS: "-j2"
38+
- name: cpack
39+
run: cd cmake-build-release && cpack -G DEB && cd ..
40+
# upload artifact
41+
- uses: mad9000/actions-find-and-replace-string@3
42+
id: container
43+
with:
44+
source: ${{ matrix.container }}
45+
find: ':' # we want to remove : from container name
46+
replace: '-' # and replace it with -
47+
48+
- name: Upload Qldd binary
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: ${{ format('Qldd-1.1.1.{0}', steps.container.outputs.value) }}
52+
path: cmake-build-release/Qldd-1.1.1-x86_64.???
53+
ubuntu-20-04:
54+
runs-on: ubuntu-latest
55+
strategy:
56+
#
57+
# matrix for containers
58+
#
59+
matrix:
60+
container:
61+
- ubuntu:20.04
62+
63+
container:
64+
image: ${{ matrix.container }}
65+
66+
steps:
67+
- name: Get current date
68+
id: date
69+
run: echo "date=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
70+
- name: Get commit sha
71+
id: git_sha
72+
run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
73+
- uses: actions/checkout@v3
74+
# install dependencies
75+
- name: devel-pkgs
76+
run: |
77+
apt-get update -y && apt-get install -yq binutils python3-nautilus make cmake qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gcc g++
78+
# build project
79+
- name: mkdir
80+
run: mkdir cmake-build-release
81+
- name: cmake cmake-build-release
82+
run: cmake -DCOMMITTER_DATE="${{ steps.date.outputs.date }}" -DCOMMITTER_FULLSHA="${{ steps.git_sha.outputs.git_sha }}" -DCOMMITTER_SHORTSHA="$(echo ${{ steps.git_sha.outputs.git_sha }} | cut -c1-7)" -DCMAKE_BUILD_TYPE=Release -Bcmake-build-release -H.
83+
- name: cmake make
84+
run: cmake --build cmake-build-release/ --target all
85+
env:
86+
MAKEFLAGS: "-j2"
87+
- name: cpack
88+
run: cd cmake-build-release && cpack -G DEB && cd ..
89+
# upload artifact
90+
- uses: mad9000/actions-find-and-replace-string@3
91+
id: container
92+
with:
93+
source: ${{ matrix.container }}
94+
find: ':' # we want to remove : from container name
95+
replace: '-' # and replace it with -
96+
97+
- name: Upload Qldd binary
98+
uses: actions/upload-artifact@v3
99+
with:
100+
name: ${{ format('Qldd-1.1.1.{0}', steps.container.outputs.value) }}
101+
path: cmake-build-release/Qldd-1.1.1-x86_64.???
102+
debian-bullseye:
103+
runs-on: ubuntu-latest
104+
strategy:
105+
#
106+
# matrix for containers
107+
#
108+
matrix:
109+
container:
110+
- debian:bullseye
111+
112+
container:
113+
image: ${{ matrix.container }}
114+
115+
steps:
116+
- name: Get current date
117+
id: date
118+
run: echo "date=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
119+
- name: Get commit sha
120+
id: git_sha
121+
run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
122+
- uses: actions/checkout@v3
123+
# install dependencies
124+
- name: devel-pkgs
125+
run: |
126+
apt-get update -y && apt-get install -yq binutils python3-nautilus make cmake qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gcc g++
127+
# build project
128+
- name: mkdir
129+
run: mkdir cmake-build-release
130+
- name: cmake cmake-build-release
131+
run: cmake -DCOMMITTER_DATE="${{ steps.date.outputs.date }}" -DCOMMITTER_FULLSHA="${{ steps.git_sha.outputs.git_sha }}" -DCOMMITTER_SHORTSHA="$(echo ${{ steps.git_sha.outputs.git_sha }} | cut -c1-7)" -DCMAKE_BUILD_TYPE=Release -Bcmake-build-release -H.
132+
- name: cmake make
133+
run: cmake --build cmake-build-release/ --target all
134+
env:
135+
MAKEFLAGS: "-j2"
136+
- name: cpack
137+
run: cd cmake-build-release && cpack -G DEB && cd ..
138+
# upload artifact
139+
- uses: mad9000/actions-find-and-replace-string@3
140+
id: container
141+
with:
142+
source: ${{ matrix.container }}
143+
find: ':' # we want to remove : from container name
144+
replace: '-' # and replace it with -
145+
146+
- name: Upload Qldd binary
147+
uses: actions/upload-artifact@v3
148+
with:
149+
name: ${{ format('Qldd-1.1.1.{0}', steps.container.outputs.value) }}
150+
path: cmake-build-release/Qldd-1.1.1-x86_64.???
151+
debian-buster:
152+
runs-on: ubuntu-latest
153+
strategy:
154+
#
155+
# matrix for containers
156+
#
157+
matrix:
158+
container:
159+
- debian:buster
160+
161+
container:
162+
image: ${{ matrix.container }}
163+
164+
steps:
165+
- name: Get current date
166+
id: date
167+
run: echo "date=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
168+
- name: Get commit sha
169+
id: git_sha
170+
run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
171+
- uses: actions/checkout@v3
172+
# install dependencies
173+
- name: devel-pkgs
174+
run: |
175+
apt-get update -y && apt-get install -yq binutils python3-nautilus make cmake qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gcc g++
176+
# build project
177+
- name: mkdir
178+
run: mkdir cmake-build-release
179+
- name: cmake cmake-build-release
180+
run: cmake -DCOMMITTER_DATE="${{ steps.date.outputs.date }}" -DCOMMITTER_FULLSHA="${{ steps.git_sha.outputs.git_sha }}" -DCOMMITTER_SHORTSHA="$(echo ${{ steps.git_sha.outputs.git_sha }} | cut -c1-7)" -DCMAKE_BUILD_TYPE=Release -Bcmake-build-release -H.
181+
- name: cmake make
182+
run: cmake --build cmake-build-release/ --target all
183+
env:
184+
MAKEFLAGS: "-j2"
185+
- name: cpack
186+
run: cd cmake-build-release && cpack -G DEB && cd ..
187+
# upload artifact
188+
- uses: mad9000/actions-find-and-replace-string@3
189+
id: container
190+
with:
191+
source: ${{ matrix.container }}
192+
find: ':' # we want to remove : from container name
193+
replace: '-' # and replace it with -
194+
195+
- name: Upload Qldd binary
196+
uses: actions/upload-artifact@v3
197+
with:
198+
name: ${{ format('Qldd-1.1.1.{0}', steps.container.outputs.value) }}
199+
path: cmake-build-release/Qldd-1.1.1-x86_64.???
200+
centos-latest:
201+
runs-on: ubuntu-latest
202+
strategy:
203+
#
204+
# matrix for containers
205+
#
206+
matrix:
207+
container:
208+
- centos:latest
209+
210+
container:
211+
image: ${{ matrix.container }}
212+
213+
steps:
214+
- name: Get current date
215+
id: date
216+
run: echo "date=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
217+
- name: Get commit sha
218+
id: git_sha
219+
run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
220+
- uses: actions/checkout@v3
221+
# install dependencies
222+
- name: devel-pkgs
223+
run: |
224+
cd /etc/yum.repos.d/ &&
225+
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* &&
226+
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* &&
227+
cd / &&
228+
yum update -y && yum install -yq epel-next-release &&
229+
yum update -y && yum install -yq binutils python3-nautilus qt5-qtbase-devel qt5-qttools rpm-build
230+
# build project
231+
- name: mkdir
232+
run: mkdir cmake-build-release
233+
- name: cmake cmake-build-release
234+
run: cmake -DCOMMITTER_DATE="${{ steps.date.outputs.date }}" -DCOMMITTER_FULLSHA="${{ steps.git_sha.outputs.git_sha }}" -DCOMMITTER_SHORTSHA="$(echo ${{ steps.git_sha.outputs.git_sha }} | cut -c1-7)" -DCMAKE_BUILD_TYPE=Release -Bcmake-build-release -H.
235+
- name: cmake make
236+
run: cmake --build cmake-build-release/ --target all
237+
env:
238+
MAKEFLAGS: "-j2"
239+
- name: cpack
240+
run: cd cmake-build-release && cpack -G RPM && cd ..
241+
# upload artifact
242+
- uses: mad9000/actions-find-and-replace-string@3
243+
id: container
244+
with:
245+
source: ${{ matrix.container }}
246+
find: ':' # we want to remove : from container name
247+
replace: '-' # and replace it with -
248+
249+
- name: Upload Qldd binary
250+
uses: actions/upload-artifact@v3
251+
with:
252+
name: ${{ format('Qldd-1.1.1.{0}', steps.container.outputs.value) }}
253+
path: cmake-build-release/Qldd-1.1.1-x86_64.???
254+
fedora-latest:
255+
runs-on: ubuntu-latest
256+
strategy:
257+
#
258+
# matrix for containers
259+
#
260+
matrix:
261+
container:
262+
- fedora:latest
263+
264+
container:
265+
image: ${{ matrix.container }}
266+
267+
steps:
268+
- name: Get current date
269+
id: date
270+
run: echo "date=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
271+
- name: Get commit sha
272+
id: git_sha
273+
run: echo "git_sha=$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
274+
- uses: actions/checkout@v3
275+
# install dependencies
276+
- name: devel-pkgs
277+
run: |
278+
yum update -y && yum install -yq binutils python3-nautilus qt5-qtbase-devel qt5-qttools rpm-build
279+
# build project
280+
- name: mkdir
281+
run: mkdir cmake-build-release
282+
- name: cmake cmake-build-release
283+
run: cmake -DCOMMITTER_DATE="${{ steps.date.outputs.date }}" -DCOMMITTER_FULLSHA="${{ steps.git_sha.outputs.git_sha }}" -DCOMMITTER_SHORTSHA="$(echo ${{ steps.git_sha.outputs.git_sha }} | cut -c1-7)" -DCMAKE_BUILD_TYPE=Release -Bcmake-build-release -H.
284+
- name: cmake make
285+
run: cmake --build cmake-build-release/ --target all
286+
env:
287+
MAKEFLAGS: "-j2"
288+
- name: cpack
289+
run: cd cmake-build-release && cpack -G RPM && cd ..
290+
# upload artifact
291+
- uses: mad9000/actions-find-and-replace-string@3
292+
id: container
293+
with:
294+
source: ${{ matrix.container }}
295+
find: ':' # we want to remove : from container name
296+
replace: '-' # and replace it with -
297+
298+
- name: Upload Qldd binary
299+
uses: actions/upload-artifact@v3
300+
with:
301+
name: ${{ format('Qldd-1.1.1.{0}', steps.container.outputs.value) }}
302+
path: cmake-build-release/Qldd-1.1.1-x86_64.???

0 commit comments

Comments
 (0)