File: MakeRelease.sh

package info (click to toggle)
ffmpegthumbnailer 2.2.2%2Bgit20220218%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 864 kB
  • sloc: cpp: 11,403; ansic: 76; sh: 37; makefile: 13
file content (52 lines) | stat: -rw-r--r-- 1,578 bytes parent folder | download | duplicates (2)
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
#!/bin/bash

function checkresult {
    "$@"
    local status=$?
    if [ $status -ne 0 ]; then
        echo "error with $@ status=$status" >&2
        exit $status
    fi
    return $status
}

option=$1

project="ffmpegthumbnailer"

if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]
then
	echo "git status is not clean, commit changes first"
	#exit 1
fi

#get version number
version_major=`cat CMakeLists.txt | grep set\(PACKAGE_VERSION_MAJOR | cut -d ' ' -f2 | sed 's/)//'`
version_minor=`cat CMakeLists.txt | grep set\(PACKAGE_VERSION_MINOR | cut -d ' ' -f2 | sed 's/)//'`
version_patch=`cat CMakeLists.txt | grep set\(PACKAGE_VERSION_PATCH | cut -d ' ' -f2 | sed 's/)//'`
version="${version_major}.${version_minor}.${version_patch}"

echo $version

#build the code
builddir="out-$version"
rm -rf $builddir
mkdir -p $builddir

cd $builddir
checkresult cmake -DENABLE_TESTS=ON -DENABLE_THUMBNAILER=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_STATIC=ON -DENABLE_SHARED=ON ..
checkresult make -j4
checkresult ctest CTEST_OUTPUT_ON_FAILURE=1
checkresult make package_source
cd ..

if [ "$option" == "noupload" ]
then
    echo "Skipping upload"
	exit 0
fi

#upload archive to google
checkresult github-release release --user dirkvdb --repo ffmpegthumbnailer --tag ${version} --name ffmpegthumbnailer-${version} --description "ffmpegthumbnailer release ${version}"
checkresult github-release upload --user dirkvdb --repo ffmpegthumbnailer --tag ${version} --name ffmpegthumbnailer-${version}.tar.bz2 --file ${builddir}/ffmpegthumbnailer-${version}.tar.bz2
rm -rf $builddir