diff --git a/.github/workflows/build_ubuntu_deb.yml b/.github/workflows/build_ubuntu_deb.yml new file mode 100644 index 00000000..6e1b7814 --- /dev/null +++ b/.github/workflows/build_ubuntu_deb.yml @@ -0,0 +1,37 @@ +name: Build deb package (Ubuntu 24.04) +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +jobs: + Ubuntu: + runs-on: ubuntu-24.04 + steps: + - name: Clone Tree + uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + g++ ninja-build \ + libgtk2.0-dev \ + libopenal-dev \ + libopenvr-dev \ + libgl-dev \ + libconfig++-dev libconfig-dev \ + libxpm-dev \ + libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev libswscale-dev \ + build-essential devscripts + - name: Compile + run: | + ./distribution/buildDebSrc.sh + #- name: Upload artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: sview-debpackage + # path: distribution/temp diff --git a/distribution/buildDebSrc.sh b/distribution/buildDebSrc.sh index 561fbfbe..4c7c67e0 100755 --- a/distribution/buildDebSrc.sh +++ b/distribution/buildDebSrc.sh @@ -7,12 +7,47 @@ # go to the script directory aScriptPath=${BASH_SOURCE%/*} if [ -d "$aScriptPath" ]; then - cd "$aScriptPath" + cd "$aScriptPath" fi +#sudo apt-get install build-essential devscripts + +# build source package and sign it +#debuildParams=-S +# build unsigned source package +#debuildParams=-S -us -uc +# build unsigned source and binary packages +debuildParams=-us -uc + +aCurrentRelease=`lsb_release -c -s` +aDistribs=("$aCurrentRelease") + +# Ubuntu 14.04 LTS (Trusty Tahr) +# Ubuntu 15.04 (Vivid Vervet) +# Ubuntu 15.10 (Wily Werewolf) +# Ubuntu 16.04 LTS (Xenial Xerus) +# Ubuntu 16.10 (Yakkety Yak) +# Ubuntu 17.04 (Zesty Zapus) +# Ubuntu 17.10 (Artful Aardvark) +# Ubuntu 18.04 LTS (Bionic Beaver) +# Ubuntu 18.10 (Cosmic Cuttlefish) +# Ubuntu 19.04 (Disco Dingo) +# Ubuntu 19.10 +# Ubuntu 20.04 LTS (Focal Fossa) +# Ubuntu 20.10 (Groovy Gorilla) +# Ubuntu 21.04 (Hirsute Hippo) +# Ubuntu 21.10 (Impish Indri) +# Ubuntu 22.04 LTS (Jammy Jellyfish) +# Ubuntu 24.04 LTS (Noble Numbat) +#aDistribs=("focal" "jammy" "noble") + +# Debian +#aDistribs=("stable" "unstable" "testing-proposed-updates" "experimental") + YEAR=$(date +"%y") MONTH=$(date +"%m") DAY=$(date +"%d") +aCurrentDate=`date --rfc-2822` aVersion=${YEAR}.${MONTH} aRelease=1 aDebVersion=${aVersion}-${aRelease} @@ -65,9 +100,47 @@ sed "s/unknown_release/${aRelease}/g" "$aDebSrcRoot/sView.rpm.spectmp1" > "$aDe #sed "s/unknown_date/${aCurrentDate}/g" "$aDebSrcRoot/sView.rpm.spectmp2" > "$aDebSrcRoot/sView.rpm.spec" rm -f $aDebSrcRoot/sView.rpm.spectmp* -pushd . -cd temp +# backup unmodified sources into archive +pushd temp tar -czvf sview-${aVersion}-${aRelease}.tar.gz sview-${aVersion}-${aRelease} mkdir -p src mv -f sview-${aVersion}-${aRelease}.tar.gz ./src popd + +# remove temporary files +rm -f temp/*.build +rm -f temp/*.buildinfo +rm -f temp/*.changes +rm -f temp/*.dsc +rm -f temp/*.tar.gz +rm -f temp/*.tar.xz + +# build Debian package(s) +pushd ${aDebSrcRoot} +for aDistr in "${aDistribs[@]}" +do + echo "Prepare source package for '$aDistr'" + sed "s/unknown_distrib/${aDistr}/g" "debian/changelog.tmpl" > "debian/changelogtmp1" + sed "s/unknown_version/1:${aDebVersion}~${aDistr}/g" "debian/changelogtmp1" > "debian/changelogtmp2" + sed "s/unknown_date/${aCurrentDate}/g" "debian/changelogtmp2" > "debian/changelog" + rm -f debian/changelogtmp* + + mkdir -p ../$aDistr + debuild "${debuildParams[@]}" + mv -f ../*.build ../$aDistr + mv -f ../*.buildinfo ../$aDistr + mv -f ../*.changes ../$aDistr + mv -f ../*.dsc ../$aDistr + mv -f ../*.tar.*z ../$aDistr + #mv -f ../*.tar.gz ../$aDistr + #mv -f ../*.tar.xz ../$aDistr + #mv -f ../*.deb ../$aDistr +done + +#for aDistr in "${aDistribs[@]}" +#do +# dput ppa:sview/stable ../$aDistr/sview_${aDebVersion}~${aDistr}_source.changes +#done + +# turn back to original directory +popd