-
Notifications
You must be signed in to change notification settings - Fork 7
156 lines (123 loc) · 4.61 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
name: Build
on: [push, pull_request]
env:
BUILD_TYPE: Release
jobs:
build-debian:
name: Debian
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Build Environment
run: cd contrib/ci/ && podman build -t pomidaq -f Dockerfile-debian .
- name: Build
run: |
podman run -t -e COMPILER_VENDOR=$CVENDOR -e CC=gcc -e CXX=g++ \
-e [email protected] \
-v `pwd`:/build pomidaq ./contrib/ci/cibuild.sh
- name: Upload Debian package artifact
uses: actions/upload-artifact@v4
with:
name: Debian Package
path: pomidaq_*.deb
build-ubuntu:
name: Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Build Environment
run: cd contrib/ci/ && podman build -t pomidaq -f Dockerfile-ubuntu .
- name: Build
run: |
podman run -t -e COMPILER_VENDOR=$CVENDOR -e CC=gcc -e CXX=g++ \
-e [email protected] \
-v `pwd`:/build pomidaq ./contrib/ci/cibuild.sh
- name: Upload Ubuntu package artifact
uses: actions/upload-artifact@v4
with:
name: Ubuntu Package
path: pomidaq_*.deb
build-windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 5.15.*
- name: Make vcpkg only build release builds
run: |
"`r`nset(VCPKG_BUILD_TYPE release)" | Add-Content "$env:VCPKG_INSTALLATION_ROOT\triplets\x64-windows.cmake"
"`r`nset(VCPKG_BUILD_TYPE release)" | Add-Content "$env:VCPKG_INSTALLATION_ROOT\triplets\x64-windows-static.cmake"
- name: Setup OpenCV
run: vcpkg install --triplet x64-windows opencv[core,opengl,world]
- name: Setup FFmpeg
run: |
vcpkg install --triplet x86-windows yasm-tool
vcpkg install --triplet x64-windows ffmpeg[core,avcodec,avfilter,avformat,swresample,swscale,vpx,opus,openssl]
- name: Determine PoMiDAQ revision number
shell: bash
run: |
git_commit=$(git log --pretty="format:%h" -n1)
git_current_tag=$(git describe --tags --abbrev=0 2> /dev/null || echo "v0.1")
git_commit_no=$(git rev-list --count HEAD)
PMD_VERSION=$(echo "${git_current_tag}" | sed 's/^v\(.\+\)$/\1/;s/[-]/~/g')
PMD_VERSION="$PMD_VERSION+git$git_commit_no"
echo "PMD_VERSION=${PMD_VERSION}" >> $GITHUB_ENV
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure Build
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/PoMiDAQ-$PMD_VERSION" \
-DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" \
-DVCPKG_TARGET_TRIPLET="x64-windows" \
-DOpenCV_DIR="C:/vcpkg/installed/x64-windows/share/opencv" \
-DFFmpegPath="C:/vcpkg/installed/x64-windows/share/ffmpeg" \
-DGUI=ON \
-DPYTHON=OFF
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE
- name: Install & Bundle
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
cmake --build . --config $BUILD_TYPE --target install
cd $GITHUB_WORKSPACE
DEPLOY_DIR=$GITHUB_WORKSPACE/PoMiDAQ-$PMD_VERSION
VCPKG_BIN_DIR="C:/vcpkg/installed/x64-windows/bin"
windeployqt \
--no-quick-import \
--no-translations \
$DEPLOY_DIR/bin/pomidaq.exe
# FFmpeg
cp $VCPKG_BIN_DIR/av*.dll $DEPLOY_DIR/bin/
cp $VCPKG_BIN_DIR/sw*.dll $DEPLOY_DIR/bin/
# OpenCV
cp $VCPKG_BIN_DIR/opencv*.dll $DEPLOY_DIR/bin/
# Install all DLLs, we assume all are needed
install $VCPKG_BIN_DIR/*.dll $DEPLOY_DIR/bin/
# Misc
cp LICENSE $DEPLOY_DIR/LICENSE.txt
cp README.md $DEPLOY_DIR/
cp contrib/LICENSES.3rd-party $DEPLOY_DIR/LICENSES_3rd-party.txt
# move deploy dir into subdirectory
mkdir -p $GITHUB_WORKSPACE/win64-deploy
mv $DEPLOY_DIR $GITHUB_WORKSPACE/win64-deploy/
- name: Upload Windows build
uses: actions/upload-artifact@v4
with:
name: PoMiDAQ-${{env.PMD_VERSION}}_win64
path: win64-deploy/