Skip to content

Commit

Permalink
Merge pull request #57 from rf152/main
Browse files Browse the repository at this point in the history
Moved libraries around, added auto release
rf152 authored Dec 16, 2022
2 parents cf16d35 + ba6e179 commit bdfa99c
Showing 11 changed files with 78 additions and 96 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/build-arm32.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/build-arm64.yml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
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: 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
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
@@ -4,10 +4,10 @@ if [ ! -d "build" ]; then
mkdir build
fi

if [ $(uname -m) == "aarch64" ]; then
ln -s lib64 lib
if [ -d "lib-$(uname -m)" ]; then
ln -s lib-$(uname -m) lib
else
ln -s lib32 lib
ln -s lib-armv7 lib
fi

cd build
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@ mkdir "$INSTALL_DIR"
mkdir "$LIB_DIR"
mkdir "$BIN_DIR"

if [ $(uname -m) == "aarch64" ]; then
cp lib64/ndi/* "$LIB_DIR"
if [ -d "lib-$(uname -m)" ]; then
cp lib-$(uname -m)/ndi/* "$LIB_DIR"
else
cp lib32/ndi/* "$LIB_DIR"
cp lib-armv7/ndi/* "$LIB_DIR"
fi

cp build/src/raspindi "$BIN_DIR"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit bdfa99c

Please sign in to comment.