Skip to content

Commit 438f090

Browse files
committed
Merge branch 'Travis'
2 parents 32b132d + 34de06b commit 438f090

File tree

4 files changed

+123
-17
lines changed

4 files changed

+123
-17
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ linuxbuild.*
1919
macbuild.*
2020
/mac/
2121
installers/debian.deb
22+
OpenBVE-*.zip
23+
OpenBVE-*.deb
24+
OpenBVE-*.dmg
2225

2326
#Debian Build directory
2427
installers/debian/usr/lib/*

.travis.yml

+4-17
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,10 @@ matrix:
1616
script: make debian
1717
if: tag IS present
1818

19-
#Test builds
20-
##Use makefile##
21-
- os: linux
22-
dist: xenial
23-
mono: latest
24-
script: make all-release
25-
- os: osx
26-
mono: latest
27-
script: make all-release
28-
- os: linux
29-
dist: trusty
30-
mono: 5.20.1
31-
script: make all-release
32-
##Use .sln file##
19+
#Further test builds on different Ubuntu / Mono versions and using the SLN file directly
20+
21+
#Note: Only run the single uploading build on MacOS https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing
22+
#Let's test all variations on Linux. This will (probably) ensure that things go OK
3323
- os: linux
3424
dist: trusty
3525
mono: latest
@@ -38,9 +28,6 @@ matrix:
3828
dist: xenial
3929
mono: latest
4030
solution: OpenBVE.sln
41-
- os: osx
42-
mono: latest
43-
solution: OpenBVE.sln
4431
- os: linux
4532
dist: trusty
4633
mono: 5.20.1

azure-pipelines.yml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# This YAML runs the daily test and upload builds on the master branch
2+
3+
trigger:
4+
- master
5+
6+
### Test on latest Windows and .Net version
7+
8+
jobs:
9+
- job: WindowsBuild
10+
displayName: 'Build on Windows (sln)'
11+
pool:
12+
vmImage: 'windows-latest'
13+
14+
variables:
15+
solution: 'OpenBVE.sln'
16+
buildPlatform: 'Any CPU'
17+
buildConfiguration: 'Release'
18+
19+
steps:
20+
- task: NuGetToolInstaller@1
21+
22+
- task: NuGetCommand@2
23+
inputs:
24+
restoreSolution: '$(solution)'
25+
26+
- task: VSBuild@1
27+
inputs:
28+
solution: '$(solution)'
29+
platform: '$(buildPlatform)'
30+
configuration: '$(buildConfiguration)'
31+
32+
### Build and upload via makefile on OS-X
33+
### This uses Mono 6.8.0 as the default version isn't high enough on this image
34+
### As we're 32-bit only at present 10.15+ is no good to us
35+
36+
- job: AppleMakeBuild
37+
displayName: 'Build on Apple OS-X (makefile)'
38+
pool:
39+
vmImage: 'macos-10.14'
40+
41+
variables:
42+
solution: 'OpenBVE.sln'
43+
buildPlatform: 'Any CPU'
44+
buildConfiguration: 'Release'
45+
46+
steps:
47+
- task: NuGetToolInstaller@1
48+
### Default Mono version isn't high enough on this OS-X image so kick to the latest
49+
- script: sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 6_8_0
50+
- script: make publish
51+
- task: CopyFilesOverSSH@0
52+
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
53+
inputs:
54+
sshEndpoint: 'BuildServer'
55+
sourceFolder: $(Pipeline.Workspace)/s/
56+
contents: /*.dmg
57+
targetFolder: '/var/www/vps.bvecornwall.co.uk/public/OpenBVE/Builds/'
58+
overwrite: true
59+
readyTimeout: 90000
60+
61+
### Linux makefile build
62+
### This runs on the latest Mono version installed
63+
64+
- job: LinuxMakeBuild
65+
displayName: 'Build on Linux (makefile)'
66+
pool:
67+
vmImage: 'ubuntu-16.04'
68+
69+
variables:
70+
solution: 'OpenBVE.sln'
71+
buildPlatform: 'Any CPU'
72+
buildConfiguration: 'Release'
73+
74+
steps:
75+
- task: NuGetToolInstaller@1
76+
- script: make publish
77+
- task: CopyFilesOverSSH@0
78+
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
79+
inputs:
80+
sshEndpoint: 'BuildServer'
81+
sourceFolder: $(Pipeline.Workspace)/s/
82+
contents: /*.zip
83+
targetFolder: '/var/www/vps.bvecornwall.co.uk/public/OpenBVE/Builds/'
84+
overwrite: true
85+
readyTimeout: 90000

makefile

+31
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ MONO_VERSION:= $(shell mono --version | awk '/version/ { print $$5 }')
55
MIN_NUGET_VERSION:= "2.16.0"
66
NUGET_VERSION:= $(shell nuget help 2> /dev/null | awk '/Version:/ { print $$3; exit 0}')
77
GreaterVersion = $(shell printf '%s\n' $(1) $(2) | sort -t. -k 1,1nr -k 2,2nr -k 3,3nr -k 4,4nr | head -n 1)
8+
PROGRAM_VERSION = $(shell git describe --tags --exact-match 2> /dev/null)
89

910
# Directories
1011
DEBUG_DIR := bin_debug
@@ -157,11 +158,31 @@ $(MAC_BUILD_RESULT): all-release
157158

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

161172
$(LINUX_BUILD_RESULT): all-release
162173
@rm -rf bin_release/DevTools/
163174
@echo $(COLOR_RED)Compressing $(COLOR_CYAN)$(LINUX_BUILD_RESULT)$(COLOR_END)
164175
@cd $(RELEASE_DIR); zip -qr9Z deflate ../$(LINUX_BUILD_RESULT) *
176+
@echo Renaming final output file
177+
ifeq (, $(PROGRAM_VERSION))
178+
@echo This is a $(COLOR_BLUE)Daily build$(COLOR_END)
179+
@echo Final filename: $(COLOR_RED)OpenBVE-$$(date '+%F').zip$(COLOR_END)
180+
@mv linuxbuild.zip OpenBVE-$$(date '+%F').zip
181+
else
182+
@echo This is a $(COLOR_YELLOW)Tagged Release build$(COLOR_END)
183+
@echo Final filename: $(COLOR_RED)OpenBVE-$(PROGRAM_VERSION).zip$(COLOR_END)
184+
@mv linuxbuild.zip OpenBVE-$(PROGRAM_VERSION).zip
185+
endif
165186

166187
$(DEBIAN_BUILD_RESULT): all-release
167188
@rm -rf bin_release/DevTools/
@@ -174,3 +195,13 @@ $(DEBIAN_BUILD_RESULT): all-release
174195
@cp -r -f $(CP_UPDATE_FLAG) $(RELEASE_DIR)/* installers/debian/usr/lib/openbve
175196
@echo $(COLOR_RED)Compressing $(COLOR_CYAN)$(DEBIAN_BUILD_RESULT)$(COLOR_END)
176197
@fakeroot dpkg-deb --build installers/debian
198+
@echo Renaming final output file
199+
ifeq (, $(PROGRAM_VERSION))
200+
@echo This is a $(COLOR_BLUE)Daily build$(COLOR_END)
201+
@echo Final filename: $(COLOR_RED)OpenBVE-$$(date '+%F').deb$(COLOR_END)
202+
@mv debianbuild.deb OpenBVE-$$(date '+%F').deb
203+
else
204+
@echo This is a $(COLOR_YELLOW)Tagged Release build$(COLOR_END)
205+
@echo Final filename: $(COLOR_RED)OpenBVE-$$(date '+%F').deb$(COLOR_END)
206+
@mv debianbuild.deb OpenBVE-$(PROGRAM_VERSION).deb
207+
endif

0 commit comments

Comments
 (0)