Skip to content

Commit

Permalink
Merge branch 'Travis'
Browse files Browse the repository at this point in the history
  • Loading branch information
leezer3 committed Nov 20, 2020
2 parents 32b132d + 34de06b commit bad6395
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ linuxbuild.*
macbuild.*
/mac/
installers/debian.deb
OpenBVE-*.zip
OpenBVE-*.deb
OpenBVE-*.dmg

#Debian Build directory
installers/debian/usr/lib/*
Expand Down
21 changes: 4 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,10 @@ matrix:
script: make debian
if: tag IS present

#Test builds
##Use makefile##
- os: linux
dist: xenial
mono: latest
script: make all-release
- os: osx
mono: latest
script: make all-release
- os: linux
dist: trusty
mono: 5.20.1
script: make all-release
##Use .sln file##
#Further test builds on different Ubuntu / Mono versions and using the SLN file directly

#Note: Only run the single uploading build on MacOS https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing
#Let's test all variations on Linux. This will (probably) ensure that things go OK
- os: linux
dist: trusty
mono: latest
Expand All @@ -38,9 +28,6 @@ matrix:
dist: xenial
mono: latest
solution: OpenBVE.sln
- os: osx
mono: latest
solution: OpenBVE.sln
- os: linux
dist: trusty
mono: 5.20.1
Expand Down
85 changes: 85 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# This YAML runs the daily test and upload builds on the master branch

trigger:
- master

### Test on latest Windows and .Net version

jobs:
- job: WindowsBuild
displayName: 'Build on Windows (sln)'
pool:
vmImage: 'windows-latest'

variables:
solution: 'OpenBVE.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'

- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'

### Build and upload via makefile on OS-X
### This uses Mono 6.8.0 as the default version isn't high enough on this image
### As we're 32-bit only at present 10.15+ is no good to us

- job: AppleMakeBuild
displayName: 'Build on Apple OS-X (makefile)'
pool:
vmImage: 'macos-10.14'

variables:
solution: 'OpenBVE.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1
### Default Mono version isn't high enough on this OS-X image so kick to the latest
- script: sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 6_8_0
- script: make publish
- task: CopyFilesOverSSH@0
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
sshEndpoint: 'BuildServer'
sourceFolder: $(Pipeline.Workspace)/s/
contents: /*.dmg
targetFolder: '/var/www/vps.bvecornwall.co.uk/public/OpenBVE/Builds/'
overwrite: true
readyTimeout: 20000

### Linux makefile build
### This runs on the latest Mono version installed

- job: LinuxMakeBuild
displayName: 'Build on Linux (makefile)'
pool:
vmImage: 'ubuntu-16.04'

variables:
solution: 'OpenBVE.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1
- script: make publish
- task: CopyFilesOverSSH@0
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
sshEndpoint: 'BuildServer'
sourceFolder: $(Pipeline.Workspace)/s/
contents: /*.zip
targetFolder: '/var/www/vps.bvecornwall.co.uk/public/OpenBVE/Builds/'
overwrite: true
readyTimeout: 20000
31 changes: 31 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ MONO_VERSION:= $(shell mono --version | awk '/version/ { print $$5 }')
MIN_NUGET_VERSION:= "2.16.0"
NUGET_VERSION:= $(shell nuget help 2> /dev/null | awk '/Version:/ { print $$3; exit 0}')
GreaterVersion = $(shell printf '%s\n' $(1) $(2) | sort -t. -k 1,1nr -k 2,2nr -k 3,3nr -k 4,4nr | head -n 1)
PROGRAM_VERSION = $(shell git describe --tags --exact-match 2> /dev/null)

# Directories
DEBUG_DIR := bin_debug
Expand Down Expand Up @@ -157,11 +158,31 @@ $(MAC_BUILD_RESULT): all-release

@echo $(COLOR_RED)Creating $(COLOR_CYAN)$(MAC_BUILD_RESULT)$(COLOR_END)
@hdiutil create $(MAC_BUILD_RESULT) -volname "OpenBVE" -fs HFS+ -srcfolder "mac/OpenBVE.app"
@echo Renaming final output file
ifeq (, $(PROGRAM_VERSION))
@echo This is a $(COLOR_BLUE)Daily build$(COLOR_END)
@echo Final filename: $(COLOR_RED)OpenBVE-$$(date '+%F').dmg$(COLOR_END)
@mv macbuild.dmg OpenBVE-$$(date '+%F').dmg
else
@echo This is a $(COLOR_YELLOW)Tagged Release build$(COLOR_END)
@echo Final filename: $(COLOR_RED)OpenBVE-$(PROGRAM_VERSION).dmg$(COLOR_END)
@mv macbuild.dmg OpenBVE-$(PROGRAM_VERSION).dmg
endif

$(LINUX_BUILD_RESULT): all-release
@rm -rf bin_release/DevTools/
@echo $(COLOR_RED)Compressing $(COLOR_CYAN)$(LINUX_BUILD_RESULT)$(COLOR_END)
@cd $(RELEASE_DIR); zip -qr9Z deflate ../$(LINUX_BUILD_RESULT) *
@echo Renaming final output file
ifeq (, $(PROGRAM_VERSION))
@echo This is a $(COLOR_BLUE)Daily build$(COLOR_END)
@echo Final filename: $(COLOR_RED)OpenBVE-$$(date '+%F').zip$(COLOR_END)
@mv linuxbuild.zip OpenBVE-$$(date '+%F').zip
else
@echo This is a $(COLOR_YELLOW)Tagged Release build$(COLOR_END)
@echo Final filename: $(COLOR_RED)OpenBVE-$(PROGRAM_VERSION).zip$(COLOR_END)
@mv linuxbuild.zip OpenBVE-$(PROGRAM_VERSION).zip
endif

$(DEBIAN_BUILD_RESULT): all-release
@rm -rf bin_release/DevTools/
Expand All @@ -174,3 +195,13 @@ $(DEBIAN_BUILD_RESULT): all-release
@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
@echo Renaming final output file
ifeq (, $(PROGRAM_VERSION))
@echo This is a $(COLOR_BLUE)Daily build$(COLOR_END)
@echo Final filename: $(COLOR_RED)OpenBVE-$$(date '+%F').deb$(COLOR_END)
@mv debianbuild.deb OpenBVE-$$(date '+%F').deb
else
@echo This is a $(COLOR_YELLOW)Tagged Release build$(COLOR_END)
@echo Final filename: $(COLOR_RED)OpenBVE-$$(date '+%F').deb$(COLOR_END)
@mv debianbuild.deb OpenBVE-$(PROGRAM_VERSION).deb
endif

0 comments on commit bad6395

Please sign in to comment.