Skip to content

Commit

Permalink
Change: Get Travis to build the deb too
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
leezer3 committed Jul 22, 2017
1 parent 5c0d8a7 commit beafc0d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ after_success:
#Release build
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_TAG && test "$TRAVIS_OS_NAME" == "linux" && mv "linuxbuild.zip" "openBVE-$TRAVIS_TAG.zip"
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_TAG && test "$TRAVIS_OS_NAME" == "linux" && ./UploadScript.sh sshpass -e scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "openBVE-$TRAVIS_TAG.zip" $DEPLOY_USER@$DEPLOY_HOST:$RELEASE_PATH
#Create deb and push that too on releases
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_TAG && test "$TRAVIS_OS_NAME" == "linux" && make debian
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_TAG && test "$TRAVIS_OS_NAME" == "linux" && mv "installers/debian.deb" "openBVE-$TRAVIS_TAG.deb"
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_TAG && test "$TRAVIS_OS_NAME" == "linux" && ./UploadScript.sh sshpass -e scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "openBVE-$TRAVIS_TAG.deb" $DEPLOY_USER@$DEPLOY_HOST:$RELEASE_PATH
##OSX Builds##
#Nightly build
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && test "$TRAVIS_OS_NAME" == "osx" && mv "macbuild.dmg" "OpenBVE-$(date '+%F').dmg"
Expand Down
43 changes: 43 additions & 0 deletions DebianControl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
#Set base development branch revision numbers
#This needs to be bumped once we have a stable release branch
MajorVersion=1
MinorVersion=5

# cd to correct directory
cd -P -- "$(dirname -- "$0")"

#If we're a tagged commit
if (git describe --tags --exact-match 2> /dev/null) then
Version=$(git describe --tags)
InfoVersion=$(git describe --tags)
else
# determine revision and build numbers
if [[ "$OSTYPE" == "darwin"* ]]; then
#OSX
Revision=$(((($(date +%s) - $(date -jf "%Y-%m-%d" "2016-03-08" $B +%s))/86400 )+40 ))
Minutes=$(( $(date "+10#%H * 60 + 10#%M") ))
else
#Linux & Cygwin
Revision=$(( ( ($(date "+%s") - $(date --date="2016-03-08" +%s))/(60*60*24) )+40 ))
Minutes=$(( ( $(date "+%s") - $(date -d "today 0" +%s))/60 ))
fi

Version=$MajorVersion.$MinorVersion.$Revision.$Minutes
InfoVersion=$MajorVersion.$MinorVersion.$Revision.$Minutes-$USER
fi

cat > installers/debian/DEBIAN/control << EOF
Package: openbve
Priority: optional
Section: universe/games
Installed-Size: 14950
Maintainer: leezer3 <leezer3@gmail.com>
Architecture: all
Version: $Version
Provides: bve-engine
Depends: mono-runtime (>= 3.2.8), libmono-corlib4.5-cil (>= 3.2.8), libmono-system-drawing4.0-cil (>= 1.0), libmono-system-windows-forms4.0-cil (>= 1.0), libmono-system4.0-cil (>= 3.2.8), libmono-i18n4.0-all
Recommends: bve-route, bve-train
Description: realistic 3D train/railway simulator (main program)
Homepage: http://openbve-project.net
EOF
4 changes: 4 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ $(LINUX_BUILD_RESULT): all-release
$(DEBIAN_BUILD_RESULT): all-release
@echo $(COLOR_RED)Copying build into place....$(COLOR_END)
@mkdir -p installers/debian/usr/lib/openbve
#Generate current dpkg control file
@./DebianControl.sh
#Mark launch script as executable before packaging
@chmod +x installers/debian/usr/games/openbve
@cp -r -f $(CP_UPDATE_FLAG) $(RELEASE_DIR)/* installers/debian/usr/lib/openbve
@echo $(COLOR_RED)Compressing $(COLOR_CYAN)$(DEBIAN_BUILD_RESULT)$(COLOR_END)
@fakeroot dpkg-deb --build installers/debian
Expand Down

0 comments on commit beafc0d

Please sign in to comment.