Skip to content

Commit

Permalink
CI/CD - add .deb package building workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gkv311 committed Dec 25, 2024
1 parent 60b2b3b commit c8ea525
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 81 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build_ubuntu_deb.yml
Original file line number Diff line number Diff line change
@@ -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
79 changes: 76 additions & 3 deletions distribution/buildDebSrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
78 changes: 0 additions & 78 deletions distribution/buildDebSrc_ppa.sh

This file was deleted.

0 comments on commit c8ea525

Please sign in to comment.