TYPE3
[iec.git] / src / type3_AndroidCloud / anbox-master / scripts / build-debs.sh
1 #!/bin/sh
2
3 set -ex
4
5 debuild_args="$@"
6
7 if [ -z "$BUILD_ID" ]; then
8         BUILD_ID=1
9 fi
10
11 build_and_publish_package() {
12         dir="$1"
13         distro="$2"
14         ppa="$3"
15
16         cd $dir
17
18         git checkout -- debian/changelog
19
20         # Bump the current version by a minor number. Having the distro parse
21         # at the end with current date, git rev and build id will do the rest.
22         new_base_version=$(dpkg-parsechangelog --show-field Version).1
23         dch --newversion "$new_base_version~$(date +%Y%m%d).$BUILD_ID.$distro.$(git rev-parse --short HEAD)" \
24                 -D "$distro" "Nightly release"
25
26         debuild -S -sa -I "$debuild_args"
27         cd ..
28         dput "$ppa" *.changes
29 }
30
31 top_dir="$PWD"
32
33 build_and_publish_package "$top_dir" xenial "ppa:morphis/anbox-support"
34 build_and_publish_package "$top_dir" bionic "ppa:morphis/anbox-support"