Skip to content

Commit e421335

Browse files
committed
chore: upload linux builds as zip of debs
1 parent fb7836f commit e421335

33 files changed

+698
-82
lines changed

.github/workflows/linux-system.yml

Lines changed: 80 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,98 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
os:
15-
- ubuntu-22.04
16-
- ubuntu-24.04
14+
include:
15+
- os: ubuntu-22.04
16+
distribution: jammy
17+
- os: ubuntu-24.04
18+
distribution: noble
1719

1820
runs-on: ${{ matrix.os }}
1921

2022
steps:
2123
- uses: actions/checkout@v4
2224

2325
- name: Setup environment
26+
id: setup-env
2427
run: |
25-
sudo apt-get update
26-
sudo ./tools/linux/install-dependencies
27-
28-
sudo apt-get -y install software-properties-common
29-
sudo add-apt-repository ppa:casparcg/ppa
30-
31-
sudo apt-get -y install libboost-all-dev \
32-
libavcodec-dev \
33-
libavformat-dev \
34-
libavdevice-dev \
35-
libavutil-dev \
36-
libavfilter-dev \
37-
libswscale-dev \
38-
libpostproc-dev \
39-
libswresample-dev \
40-
casparcg-cef-131-dev
28+
ln -s tools/linux/deb/ubuntu-${{ matrix.distribution }}/debian ./
29+
30+
# Build a version number for this build
31+
GH_REF="${GITHUB_REF##*/}"
32+
GH_REF=$(echo "$GH_REF" | sed 's/[\/]/_/g' | sed 's/ /_/g')
33+
34+
VERSION_MAJOR=$(grep -oPi 'set\(CONFIG_VERSION_MAJOR \K\d+' src/CMakeLists.txt)
35+
VERSION_MINOR=$(grep -oPi 'set\(CONFIG_VERSION_MINOR \K\d+' src/CMakeLists.txt)
36+
VERSION_PATCH=$(grep -oPi 'set\(CONFIG_VERSION_BUG \K\d+' src/CMakeLists.txt)
37+
38+
BUILD_VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}~${GH_REF}-${{ matrix.distribution }}+${GITHUB_SHA:0:7}"
39+
echo "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_OUTPUT
40+
echo "Building as $BUILD_VERSION"
41+
42+
BUILD_FILENAME="casparcg-server-${BUILD_VERSION}"
43+
echo "BUILD_FILENAME=$BUILD_FILENAME" >> $GITHUB_OUTPUT
44+
45+
# install some needed tooling
46+
sudo apt-get update
47+
sudo apt-get -y install software-properties-common build-essential dpkg-dev debhelper devscripts
48+
sudo add-apt-repository ppa:casparcg/ppa
49+
50+
# Put something in the changelog
51+
export DEBEMAIL="builds@casparcg.com"
52+
export DEBFULLNAME="CasparCG Builds"
53+
dch -v "$BUILD_VERSION" --create -D ${{ matrix.distribution }} --package casparcg-server-beta "Build"
54+
55+
# Install build dependencies
56+
sudo apt-get build-dep .
57+
58+
# update the control file to reference the current cef version
59+
CASPARCG_CEF_VER=$(dpkg-query -W -f='${Version}' casparcg-cef-131)
60+
sed -i "s/@CASPARCG_CEF_VER@/${CASPARCG_CEF_VER}/" debian/control
61+
62+
# Download required packages
63+
cd ..
64+
apt-get download casparcg-cef-131=$CASPARCG_CEF_VER
65+
apt-get download casparcg-scanner
66+
env:
67+
CI: 1
4168

4269
- name: Run build
4370
run: |
44-
mkdir build
45-
cd build
71+
# Perform build
72+
debuild -b -uc -us
73+
env:
74+
CI: 1
4675

47-
cmake ../src -DUSE_STATIC_BOOST=OFF -DUSE_SYSTEM_FFMPEG=ON -DUSE_SYSTEM_CEF=ON
48-
make -j2
76+
- name: Collect artifacts
77+
id: artifacts
78+
run: |
79+
mkdir -p dist
80+
mv ../*.deb dist/
81+
82+
# collect some docs for the zip
83+
cp README.md dist/
84+
cp tools/linux/deb/INSTALLING dist/
85+
86+
# check if a release branch, or master, or a tag
87+
if [[ "${{ github.ref_name }}" == "master" || "${{ github.ref_name }}" == "2.3.x-lts" ]]
88+
then
89+
# Only proceed if we have an sftp password
90+
if [ -n "${{ secrets.SFTP_PASSWORD }}" ]
91+
then
92+
zip -r "${{ steps.setup-env.outputs.BUILD_FILENAME }}.zip" dist
93+
94+
set -x
95+
eval $(ssh-agent -s)
96+
mkdir -v -m 700 $HOME/.ssh
97+
ssh-keyscan -H ${{ secrets.SFTP_HOST }} > $HOME/.ssh/known_hosts
98+
sshpass -p '${{ secrets.SFTP_PASSWORD }}' rsync -avvz --mkpath "${{ steps.setup-env.outputs.BUILD_FILENAME }}.zip" "${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:${{ secrets.SFTP_ROOT }}/${{ github.ref_name }}/${{ steps.setup-env.outputs.BUILD_FILENAME }}.zip"
99+
fi
100+
fi
49101
50102
env:
51103
CI: 1
104+
105+
- uses: actions/upload-artifact@v4
106+
with:
107+
name: ${{ steps.setup-env.outputs.BUILD_FILENAME }}
108+
path: dist

.github/workflows/linux.yml

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -19,62 +19,5 @@ jobs:
1919
- name: Run build
2020
run: |
2121
./tools/linux/build-in-docker
22-
./tools/linux/extract-from-docker
23-
2422
env:
2523
CI: 1
26-
27-
- name: Download media-scanner
28-
uses: robinraju/release-downloader@v1.10
29-
with:
30-
repository: "casparcg/media-scanner"
31-
latest: true
32-
fileName: "*-linux-x64.zip"
33-
tarBall: false
34-
zipBall: false
35-
out-file-path: "casparcg_server/media-scanner"
36-
extract: true
37-
38-
- name: Tidy media-scanner download
39-
shell: bash
40-
run: |
41-
rm casparcg_server/media-scanner/*.zip
42-
mv casparcg_server/media-scanner/* casparcg_server/
43-
rmdir casparcg_server/media-scanner
44-
chmod +x casparcg_server/scanner
45-
46-
- name: Rename build
47-
id: "rename-build"
48-
shell: bash
49-
run: |
50-
TARGET=casparcg-server-${{ github.sha }}-ubuntu22.zip
51-
zip -r "$TARGET" casparcg_server/
52-
53-
echo "artifactname=$TARGET" >> $GITHUB_OUTPUT
54-
55-
# check if a release branch, or master, or a tag
56-
if [[ "${{ github.ref_name }}" == "master" || "${{ github.ref_name }}" == "2.3.x-lts" ]]
57-
then
58-
# Only proceed if we have an sftp password
59-
if [ -n "${{ secrets.SFTP_PASSWORD }}" ]
60-
then
61-
62-
echo "uploadname=$TARGET" >> $GITHUB_OUTPUT
63-
fi
64-
fi
65-
66-
- uses: actions/upload-artifact@v4
67-
with:
68-
name: upload-artifact
69-
path: ${{ steps.rename-build.outputs.artifactname }}
70-
71-
- name: Copy single file to remote
72-
if: ${{ steps.rename-build.outputs.uploadname }}
73-
timeout-minutes: 5
74-
shell: bash
75-
run: |
76-
set -x
77-
eval $(ssh-agent -s)
78-
mkdir -v -m 700 $HOME/.ssh
79-
ssh-keyscan -H ${{ secrets.SFTP_HOST }} > $HOME/.ssh/known_hosts
80-
sshpass -p "${{ secrets.SFTP_PASSWORD }}" scp -r "${{ steps.rename-build.outputs.uploadname }}" "${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:${{ secrets.SFTP_ROOT }}/${{ github.ref_name }}/${{ steps.rename-build.outputs.uploadname }}"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ casparcg_server
1414

1515
src/cmake-build-*
1616
src/.idea
17+
18+
# debian build artifacts
19+
/debian
20+
/obj-*

tools/linux/deb/INSTALLING

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Installation from Graphical User Interface
2+
3+
Double click on the casparcg-cef package. Click the install
4+
button and follow the prompts. This can then be repeated for
5+
the casparcg-server and casparcg-scanner packages if desired.
6+
7+
Installation from Command Line
8+
9+
At the command prompt type:
10+
11+
# sudo dpkg -i casparcg-*.deb
12+
13+
Then fix up any missing dependencies with:
14+
15+
# sudo apt-get install -f
16+
17+
Running
18+
19+
You will need to run both:
20+
21+
# casparcg-scanner casparcg.config
22+
23+
and
24+
25+
# casparcg-server-beta casparcg.config
26+
27+
with the same config file and potentially working directory (if the config file uses relative paths).
28+
29+
The server needs to be run as a normal user inside a running x11 server. The scanner can be run as a system service.
30+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.debhelper
2+
debhelper-build-stamp
3+
/casparcg-server-*/
4+
*.log
5+
*.substvars
6+
/files
7+
/tmp/
8+
/changelog
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CHANGELOG.md
2+
LICENSE
3+
README.md
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/dh-exec
2+
[amd64] obj-x86_64-linux-gnu/staging/bin/casparcg => /usr/bin/casparcg-server-beta
3+
src/shell/casparcg.config => /usr/share/casparcg-server-beta/casparcg.config.example
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
debian/casparcg-server-beta.1
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
NAME
2+
casparcg-server-beta - layered real-time video compositor to multiple outputs
3+
SYNOPSIS
4+
casparcg-server-beta [path-to-config]
5+
DESCRIPTION
6+
Play out professional graphics, audio and video to multiple outputs as a
7+
layerbased real-time compositor.
8+
9+
If no path-to-config is provided, the default path is 'casparcg.config'.
10+
OPTIONS
11+
There are no options.
12+
AUTHOR
13+
Petter Reinholdtsen <pere@hungry.com> wrote this manual page.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Source: casparcg-server-beta
2+
Maintainer: Julian Waller <git@julusian.co.uk>
3+
Section: video
4+
Priority: optional
5+
Standards-Version: 4.6.0.1
6+
Build-Depends: cmake,
7+
debhelper-compat (= 13),
8+
dh-exec,
9+
libavcodec-dev,
10+
libavdevice-dev,
11+
libavfilter-dev,
12+
libavformat-dev,
13+
libavutil-dev,
14+
libboost-chrono-dev,
15+
libboost-coroutine-dev,
16+
libboost-date-time-dev,
17+
libboost-dev,
18+
libboost-filesystem-dev,
19+
libboost-locale-dev,
20+
libboost-log-dev,
21+
libboost-regex-dev,
22+
libboost-system-dev,
23+
libboost-thread-dev,
24+
libfreeimage-dev,
25+
libicu-dev,
26+
libglew-dev,
27+
libjpeg-dev,
28+
libopenal-dev,
29+
libpostproc-dev,
30+
libsfml-dev,
31+
libsimde-dev,
32+
libswresample-dev,
33+
libswscale-dev,
34+
libtbb-dev,
35+
libxrandr-dev,
36+
pkg-config,
37+
txt2man,
38+
zlib1g-dev,
39+
casparcg-cef-131-dev
40+
Homepage: https://github.com/CasparCG/server/
41+
Vcs-Git: https://github.com/CasparCG/server.git
42+
Vcs-Browser: https://github.com/CasparCG/server/
43+
44+
Package: casparcg-server-beta
45+
Pre-Depends: ${misc:Pre-Depends}
46+
Depends: fonts-liberation, casparcg-cef-131 (= @CASPARCG_CEF_VER@), ${misc:Depends}, ${shlibs:Depends}
47+
Architecture: amd64
48+
Description: layered real-time video compositor to multiple outputs
49+
Play out professional graphics, audio and video to multiple outputs as a
50+
layerbased real-time compositor.

0 commit comments

Comments
 (0)