-
Notifications
You must be signed in to change notification settings - Fork 38
84 lines (70 loc) · 2.95 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
name: build
on:
push:
pull_request:
jobs:
build_job:
# The host should always be Linux
runs-on: ubuntu-latest
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}
strategy:
matrix:
include:
- arch: aarch64
distro: bullseye
- arch: armv7
distro: bullseye
steps:
- uses: actions/checkout@v3
- uses: uraimo/run-on-arch-action@v2
name: Build
id: runcmd64
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
# Not required, but speeds up builds by storing container images in
# a GitHub package registry.
githubToken: ${{ github.token }}
install: |
apt-get update -q -y
apt-get install -q -y gpg
gpg --keyserver keyserver.ubuntu.com --recv-keys cf8a1af502a2aa2d763bae7e82b129927fa3303e
gpg --armor --export cf8a1af502a2aa2d763bae7e82b129927fa3303e | apt-key add -
echo "deb http://archive.raspberrypi.org/debian/ bullseye main" > /etc/apt/sources.list.d/raspi.list
apt-get update -q -y
apt-get install -q -y --no-install-recommends cmake make gcc g++ libc6-dev libconfig++-dev libboost-program-options-dev libavahi-client3 cmake libcamera-dev libevent-pthreads-2.1-7 libevent-core-2.1-7 libevent-dev libcamera-dev libcamera0 libcamera-tools libcamera-apps-lite
run: |
ln -s lib-${{ matrix.arch }} lib
mkdir build-${{ matrix.arch }} && cd build-${{ matrix.arch }}
cmake ..
make
ls src/
mv src/raspindi raspindi-${{ matrix.arch }}
mv src/libndioutput.so libndioutput-${{ matrix.arch }}.so
- name: Package NDI
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.repository, 'raspberry-pi-camera/')
run: |
mkdir lib-${{ matrix.arch }}-release
cd lib-${{ matrix.arch }}-release
mkdir -p usr/lib
cp ../lib-${{ matrix.arch }}/ndi/* ./usr/lib/
tar -cvzf ../libndi-${{ matrix.arch }}.tar.gz usr/
echo ${{ github.event }}
- name: Artifacts - raspindi
uses: actions/upload-artifact@v3
with:
name: raspindi-${{ matrix.arch }}
path: build-${{ matrix.arch }}/raspindi-${{ matrix.arch }}
- name: Artifacts - libndioutput
uses: actions/upload-artifact@v3
with:
name: libndioutput-${{ matrix.arch }}.so
path: build-${{ matrix.arch }}/libndioutput-${{ matrix.arch }}.so
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.repository, 'raspberry-pi-camera/')
with:
files: |
build-${{ matrix.arch }}/raspindi-${{ matrix.arch }}
build-${{ matrix.arch }}/libndioutput-${{ matrix.arch }}.so
libndi-${{ matrix.arch }}.tar.gz