mirror of https://github.com/OpenTTD/OpenTTD
Fix: [AzurePipelines] switch the CI / CD to CMake too
This also means dropping Debian/jessie, as it has a CMake that is too old (3.0), with no real path to upgrade.pull/8191/head
parent
b7643b1d36
commit
4218ebc932
|
@ -14,23 +14,34 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
Win32:
|
Win32:
|
||||||
BuildPlatform: 'Win32'
|
BuildArch: 'Win32'
|
||||||
|
VcpkgTargetTriplet: 'x86-windows-static'
|
||||||
Win64:
|
Win64:
|
||||||
BuildPlatform: 'x64'
|
BuildArch: 'x64'
|
||||||
|
VcpkgTargetTriplet: 'x64-windows-static'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- template: azure-pipelines/templates/ci-git-rebase.yml
|
- template: azure-pipelines/templates/ci-git-rebase.yml
|
||||||
- template: azure-pipelines/templates/windows-dependencies.yml
|
- template: azure-pipelines/templates/windows-dependencies.yml
|
||||||
- template: azure-pipelines/templates/ci-opengfx.yml
|
- template: azure-pipelines/templates/ci-opengfx.yml
|
||||||
|
parameters:
|
||||||
|
SharedFolder: C:/Users/Public/Documents/OpenTTD
|
||||||
- template: azure-pipelines/templates/windows-build.yml
|
- template: azure-pipelines/templates/windows-build.yml
|
||||||
parameters:
|
parameters:
|
||||||
BuildPlatform: $(BuildPlatform)
|
BuildArch: $(BuildArch)
|
||||||
BuildConfiguration: Debug
|
VcpkgTargetTriplet: $(VcpkgTargetTriplet)
|
||||||
- script: |
|
BuildConfiguration: 'Debug'
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86
|
- task: VSBuild@1
|
||||||
cd projects
|
displayName: 'Prepare regression files'
|
||||||
call regression.bat
|
inputs:
|
||||||
|
solution: build/regression_files.vcxproj
|
||||||
|
configuration: 'Debug'
|
||||||
|
- task: VSBuild@1
|
||||||
displayName: 'Test'
|
displayName: 'Test'
|
||||||
|
inputs:
|
||||||
|
solution: build/RUN_TESTS.vcxproj
|
||||||
|
configuration: 'Debug'
|
||||||
|
|
||||||
|
|
||||||
- job: linux
|
- job: linux
|
||||||
displayName: 'Linux'
|
displayName: 'Linux'
|
||||||
|
@ -49,7 +60,10 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- template: azure-pipelines/templates/ci-git-rebase.yml
|
- template: azure-pipelines/templates/ci-git-rebase.yml
|
||||||
# The dockers already have the dependencies installed
|
# The dockers already have the dependencies installed
|
||||||
# The dockers already have OpenGFX installed
|
- template: azure-pipelines/templates/ci-opengfx.yml
|
||||||
|
parameters:
|
||||||
|
SharedFolder: /usr/local/share/games/openttd
|
||||||
|
PrefixCommand: sudo
|
||||||
- template: azure-pipelines/templates/linux-build.yml
|
- template: azure-pipelines/templates/linux-build.yml
|
||||||
parameters:
|
parameters:
|
||||||
Image: compile-farm-ci
|
Image: compile-farm-ci
|
||||||
|
@ -67,6 +81,13 @@ jobs:
|
||||||
- template: azure-pipelines/templates/ci-git-rebase.yml
|
- template: azure-pipelines/templates/ci-git-rebase.yml
|
||||||
- template: azure-pipelines/templates/osx-dependencies.yml
|
- template: azure-pipelines/templates/osx-dependencies.yml
|
||||||
- template: azure-pipelines/templates/ci-opengfx.yml
|
- template: azure-pipelines/templates/ci-opengfx.yml
|
||||||
|
parameters:
|
||||||
|
SharedFolder: /Library/Application Support/OpenTTD
|
||||||
|
PrefixCommand: sudo
|
||||||
- template: azure-pipelines/templates/osx-build.yml
|
- template: azure-pipelines/templates/osx-build.yml
|
||||||
- script: 'make regression'
|
- script: |
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
cd build
|
||||||
|
CTEST_OUTPUT_ON_FAILURE=1 make test
|
||||||
displayName: 'Test'
|
displayName: 'Test'
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
|
parameters:
|
||||||
|
SharedFolder: '/usr/local/share/games/openttd'
|
||||||
|
PrefixCommand: ''
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- bash: |
|
- bash: |
|
||||||
set -ex
|
set -ex
|
||||||
cd bin/baseset
|
${{ parameters.PrefixCommand }} mkdir -p "${{ parameters.SharedFolder }}/baseset"
|
||||||
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip > opengfx-all.zip
|
cd "${{ parameters.SharedFolder }}/baseset"
|
||||||
unzip opengfx-all.zip
|
${{ parameters.PrefixCommand }} curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
|
||||||
rm -f opengfx-all.zip
|
${{ parameters.PrefixCommand }} unzip opengfx-all.zip
|
||||||
|
${{ parameters.PrefixCommand }} rm -f opengfx-all.zip
|
||||||
displayName: 'Install OpenGFX'
|
displayName: 'Install OpenGFX'
|
||||||
|
|
|
@ -28,9 +28,12 @@ steps:
|
||||||
inputs:
|
inputs:
|
||||||
command: 'Run an image'
|
command: 'Run an image'
|
||||||
imageName: openttd/${{ parameters.Image }}:${{ parameters.Tag }}
|
imageName: openttd/${{ parameters.Image }}:${{ parameters.Tag }}
|
||||||
volumes: '$(Build.SourcesDirectory):$(Build.SourcesDirectory)'
|
volumes: |
|
||||||
|
$(Build.SourcesDirectory):$(Build.SourcesDirectory)
|
||||||
|
/usr/local/share/games/openttd:/usr/local/share/games/openttd
|
||||||
workingDirectory: '$(Build.SourcesDirectory)'
|
workingDirectory: '$(Build.SourcesDirectory)'
|
||||||
containerCommand: ${{ parameters.ContainerCommand }}
|
containerCommand: ${{ parameters.ContainerCommand }}
|
||||||
runInBackground: false
|
runInBackground: false
|
||||||
envVars: |
|
envVars: |
|
||||||
TARGET_BRANCH
|
TARGET_BRANCH
|
||||||
|
CTEST_OUTPUT_ON_FAILURE=1
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
steps:
|
steps:
|
||||||
# Because we run the compile in a docker (under root), we are not owner
|
# Because we run the compile in a docker (under root), we are not owner
|
||||||
# of the 'bundles' folder. Fix that by executing a chown on it.
|
# of the 'bundles' folder. Fix that by executing a chown on it.
|
||||||
- bash: sudo chown -R $(id -u):$(id -g) bundles
|
- bash: sudo chown -R $(id -u):$(id -g) build/bundles
|
||||||
displayName: 'Claim bundles folder back'
|
displayName: 'Claim bundles folder back'
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
steps:
|
steps:
|
||||||
- script: './configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig --enable-static'
|
- script: |
|
||||||
displayName: 'Configure'
|
set -ex
|
||||||
- script: 'make -j2'
|
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
|
make -j2
|
||||||
displayName: 'Build'
|
displayName: 'Build'
|
||||||
|
|
|
@ -2,11 +2,4 @@ steps:
|
||||||
- script: |
|
- script: |
|
||||||
set -ex
|
set -ex
|
||||||
HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config lzo xz libpng freetype
|
HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config lzo xz libpng freetype
|
||||||
# Remove the dynamic libraries of these libraries, to ensure we use
|
|
||||||
# the static versions. That is important, as it is unlikely any
|
|
||||||
# end-user has these brew libraries installed.
|
|
||||||
rm /usr/local/Cellar/lzo/*/lib/*.dylib
|
|
||||||
rm /usr/local/Cellar/xz/*/lib/*.dylib
|
|
||||||
rm /usr/local/Cellar/libpng/*/lib/*.dylib
|
|
||||||
rm /usr/local/Cellar/freetype/*/lib/*.dylib
|
|
||||||
displayName: 'Install dependencies'
|
displayName: 'Install dependencies'
|
||||||
|
|
|
@ -5,7 +5,14 @@ steps:
|
||||||
- ${{ if eq(parameters.CalculateChecksums, true) }}:
|
- ${{ if eq(parameters.CalculateChecksums, true) }}:
|
||||||
- bash: |
|
- bash: |
|
||||||
set -ex
|
set -ex
|
||||||
cd bundles
|
cd build/bundles
|
||||||
|
|
||||||
|
# CPack generates sha256, but with a slightly different name than
|
||||||
|
# our own convention. Also, because we rename files, the content
|
||||||
|
# might be out of date. To be safe, we remove it and replace it
|
||||||
|
# with our own version.
|
||||||
|
rm -f *.sha256
|
||||||
|
|
||||||
for i in $(ls); do
|
for i in $(ls); do
|
||||||
openssl dgst -r -md5 -hex $i > $i.md5sum
|
openssl dgst -r -md5 -hex $i > $i.md5sum
|
||||||
openssl dgst -r -sha1 -hex $i > $i.sha1sum
|
openssl dgst -r -sha1 -hex $i > $i.sha1sum
|
||||||
|
@ -15,5 +22,5 @@ steps:
|
||||||
- task: PublishBuildArtifacts@1
|
- task: PublishBuildArtifacts@1
|
||||||
displayName: 'Publish bundles'
|
displayName: 'Publish bundles'
|
||||||
inputs:
|
inputs:
|
||||||
PathtoPublish: bundles/
|
PathtoPublish: build/bundles/
|
||||||
ArtifactName: bundles
|
ArtifactName: bundles
|
||||||
|
|
|
@ -15,6 +15,6 @@ steps:
|
||||||
- script: |
|
- script: |
|
||||||
set -ex
|
set -ex
|
||||||
./azure-pipelines/manifest.sh ../a/bundles/
|
./azure-pipelines/manifest.sh ../a/bundles/
|
||||||
mkdir -p bundles
|
mkdir -p build/bundles
|
||||||
mv manifest.yaml bundles/
|
mv manifest.yaml build/bundles/
|
||||||
displayName: 'Create manifest.yaml'
|
displayName: 'Create manifest.yaml'
|
||||||
|
|
|
@ -17,7 +17,9 @@ steps:
|
||||||
git checkout -B ${BUILD_SOURCEBRANCHNAME}
|
git checkout -B ${BUILD_SOURCEBRANCHNAME}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./findversion.sh > .ottdrev
|
# Generate .ottdrev, which contains the version information
|
||||||
|
cmake -DGENERATE_OTTDREV=1 -P cmake/scripts/FindVersion.cmake
|
||||||
|
|
||||||
./azure-pipelines/changelog.sh > .changelog
|
./azure-pipelines/changelog.sh > .changelog
|
||||||
TZ='UTC' date +"%Y-%m-%d %H:%M UTC" > .release_date
|
TZ='UTC' date +"%Y-%m-%d %H:%M UTC" > .release_date
|
||||||
cat .ottdrev | cut -f 1 -d$'\t' > .version
|
cat .ottdrev | cut -f 1 -d$'\t' > .version
|
||||||
|
|
|
@ -22,9 +22,9 @@ jobs:
|
||||||
# Copy back release_date, as it is needed for the template 'release-bundles'
|
# Copy back release_date, as it is needed for the template 'release-bundles'
|
||||||
cp openttd-$(Build.BuildNumber)/.release_date .release_date
|
cp openttd-$(Build.BuildNumber)/.release_date .release_date
|
||||||
|
|
||||||
mkdir bundles
|
mkdir -p build/bundles
|
||||||
tar --xz -cf bundles/openttd-$(Build.BuildNumber)-source.tar.xz openttd-$(Build.BuildNumber)
|
tar --xz -cf build/bundles/openttd-$(Build.BuildNumber)-source.tar.xz openttd-$(Build.BuildNumber)
|
||||||
zip -9 -r -q bundles/openttd-$(Build.BuildNumber)-source.zip openttd-$(Build.BuildNumber)
|
zip -9 -r -q build/bundles/openttd-$(Build.BuildNumber)-source.zip openttd-$(Build.BuildNumber)
|
||||||
displayName: 'Create bundle'
|
displayName: 'Create bundle'
|
||||||
- template: release-bundles.yml
|
- template: release-bundles.yml
|
||||||
|
|
||||||
|
@ -39,10 +39,10 @@ jobs:
|
||||||
- script: |
|
- script: |
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
mkdir -p bundles
|
mkdir -p build/bundles
|
||||||
cp .changelog bundles/changelog.txt
|
cp .changelog build/bundles/changelog.txt
|
||||||
cp .release_date bundles/released.txt
|
cp .release_date build/bundles/released.txt
|
||||||
cp README.md bundles/README.md
|
cp README.md build/bundles/README.md
|
||||||
displayName: 'Copy meta files'
|
displayName: 'Copy meta files'
|
||||||
- template: release-bundles.yml
|
- template: release-bundles.yml
|
||||||
parameters:
|
parameters:
|
||||||
|
@ -73,33 +73,33 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
Win32:
|
Win32:
|
||||||
BuildPlatform: 'Win32'
|
|
||||||
BundlePlatform: 'win32'
|
BundlePlatform: 'win32'
|
||||||
|
BuildArch: 'Win32'
|
||||||
|
VcpkgTargetTriplet: 'x86-windows-static'
|
||||||
Win64:
|
Win64:
|
||||||
BuildPlatform: 'x64'
|
|
||||||
BundlePlatform: 'win64'
|
BundlePlatform: 'win64'
|
||||||
|
BuildArch: 'x64'
|
||||||
|
VcpkgTargetTriplet: 'x64-windows-static'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- template: release-fetch-source.yml
|
- template: release-fetch-source.yml
|
||||||
- template: windows-dependencies.yml
|
- template: windows-dependencies.yml
|
||||||
- template: windows-dependency-zip.yml
|
- template: windows-dependency-zip.yml
|
||||||
- ${{ if eq(parameters.IsStableRelease, true) }}:
|
|
||||||
- template: windows-dependency-nsis.yml
|
|
||||||
- template: windows-build.yml
|
- template: windows-build.yml
|
||||||
parameters:
|
parameters:
|
||||||
BuildPlatform: $(BuildPlatform)
|
BuildArch: $(BuildArch)
|
||||||
BuildConfiguration: Release
|
VcpkgTargetTriplet: $(VcpkgTargetTriplet)
|
||||||
- bash: |
|
BuildConfiguration: 'RelWithDebInfo'
|
||||||
set -ex
|
- task: VSBuild@1
|
||||||
make -f Makefile.msvc bundle_pdb bundle_zip PLATFORM=$(BundlePlatform) BUNDLE_NAME=openttd-$(Build.BuildNumber)-windows-$(BundlePlatform)
|
|
||||||
displayName: 'Create bundles'
|
displayName: 'Create bundles'
|
||||||
- ${{ if eq(parameters.IsStableRelease, true) }}:
|
inputs:
|
||||||
|
solution: build/PACKAGE.vcxproj
|
||||||
|
configuration: 'RelWithDebInfo'
|
||||||
- bash: |
|
- bash: |
|
||||||
set -ex
|
set -ex
|
||||||
# NSIS will be part of the Hosted image in the next update. Till then, we set the PATH ourself
|
|
||||||
export PATH="${PATH}:/c/Program Files (x86)/NSIS"
|
cp build/RelWithDebInfo/openttd.pdb build/bundles/openttd-$(Build.BuildNumber)-windows-$(BundlePlatform).pdb
|
||||||
make -f Makefile.msvc bundle_exe PLATFORM=$(BundlePlatform) BUNDLE_NAME=openttd-$(Build.BuildNumber)-windows-$(BundlePlatform)
|
displayName: 'Copy PDB to bundles folder'
|
||||||
displayName: 'Create installer bundle'
|
|
||||||
- template: release-bundles.yml
|
- template: release-bundles.yml
|
||||||
|
|
||||||
- ${{ if eq(parameters.IsStableRelease, true) }}:
|
- ${{ if eq(parameters.IsStableRelease, true) }}:
|
||||||
|
@ -153,7 +153,11 @@ jobs:
|
||||||
- template: release-fetch-source.yml
|
- template: release-fetch-source.yml
|
||||||
- template: osx-dependencies.yml
|
- template: osx-dependencies.yml
|
||||||
- template: osx-build.yml
|
- template: osx-build.yml
|
||||||
- script: 'make bundle_zip bundle_dmg BUNDLE_NAME=openttd-$(Build.BuildNumber)-macosx'
|
- script: |
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
cd build
|
||||||
|
make package
|
||||||
displayName: 'Create bundles'
|
displayName: 'Create bundles'
|
||||||
- template: release-bundles.yml
|
- template: release-bundles.yml
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
parameters:
|
parameters:
|
||||||
BuildPlatform: ''
|
BuildArch: ''
|
||||||
|
VcpkgTargetTriplet: ''
|
||||||
|
BuildConfiguration: ''
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- task: CMake@1
|
||||||
|
displayName: 'Configure'
|
||||||
|
inputs:
|
||||||
|
cmakeArgs: '.. -G "Visual Studio 15 2017" -A ${{ parameters.BuildArch }} -DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="${{ parameters.VcpkgTargetTriplet }}"'
|
||||||
- task: VSBuild@1
|
- task: VSBuild@1
|
||||||
displayName: 'Build'
|
displayName: 'Build'
|
||||||
inputs:
|
inputs:
|
||||||
solution: 'projects/openttd_vs141.sln'
|
solution: build/openttd.vcxproj
|
||||||
platform: ${{ parameters.BuildPlatform }}
|
|
||||||
configuration: ${{ parameters.BuildConfiguration }}
|
configuration: ${{ parameters.BuildConfiguration }}
|
||||||
maximumCpuCount: true
|
maximumCpuCount: true
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
parameters:
|
|
||||||
condition: true
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- bash: |
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
mkdir nsis-plugin; cd nsis-plugin
|
|
||||||
curl -L https://devs.openttd.org/~truebrain/nsis-plugins/Nsis7z.zip > Nsis7z.zip
|
|
||||||
unzip Nsis7z.zip
|
|
||||||
cp -R Plugins/* "/c/Program Files (x86)/NSIS/Plugins/"
|
|
||||||
cd ..; rm -rf nsis-plugin
|
|
||||||
|
|
||||||
mkdir nsis-plugin; cd nsis-plugin
|
|
||||||
curl -L https://devs.openttd.org/~truebrain/nsis-plugins/NsisGetVersion.zip > NsisGetVersion.zip
|
|
||||||
unzip NsisGetVersion.zip
|
|
||||||
cp -R Plugins/* "/c/Program Files (x86)/NSIS/Plugins/x86-ansi/"
|
|
||||||
cd ..; rm -rf nsis-plugin
|
|
||||||
|
|
||||||
mkdir nsis-plugin; cd nsis-plugin
|
|
||||||
curl -L https://devs.openttd.org/~truebrain/nsis-plugins/NsisFindProc.zip > NsisFindProc.zip
|
|
||||||
unzip NsisFindProc.zip
|
|
||||||
cp -R *.dll "/c/Program Files (x86)/NSIS/Plugins/x86-ansi/"
|
|
||||||
cd ..; rm -rf nsis-plugin
|
|
||||||
displayName: 'Install NSIS with the 7z, GetVersion, and FindProc plugins'
|
|
||||||
condition: and(succeeded(), ${{ parameters.condition }})
|
|
|
@ -119,6 +119,10 @@ endif ()
|
||||||
|
|
||||||
message(STATUS "Version string: ${REV_VERSION}")
|
message(STATUS "Version string: ${REV_VERSION}")
|
||||||
|
|
||||||
|
if (GENERATE_OTTDREV)
|
||||||
|
message(STATUS "Generating .ottdrev")
|
||||||
|
file(WRITE ${CMAKE_SOURCE_DIR}/.ottdrev "${REV_VERSION}\t${REV_ISODATE}\t${REV_MODIFIED}\t${REV_HASH}\t${REV_ISTAG}\t${REV_ISSTABLETAG}\t${REV_YEAR}\n")
|
||||||
|
else (GENERATE_OTTDREV)
|
||||||
message(STATUS "Generating rev.cpp")
|
message(STATUS "Generating rev.cpp")
|
||||||
configure_file("${CMAKE_SOURCE_DIR}/src/rev.cpp.in"
|
configure_file("${CMAKE_SOURCE_DIR}/src/rev.cpp.in"
|
||||||
"${FIND_VERSION_BINARY_DIR}/rev.cpp")
|
"${FIND_VERSION_BINARY_DIR}/rev.cpp")
|
||||||
|
@ -132,3 +136,4 @@ endif (WIN32)
|
||||||
message(STATUS "Generating CPackProperties.cmake")
|
message(STATUS "Generating CPackProperties.cmake")
|
||||||
configure_file("${CMAKE_SOURCE_DIR}/CPackProperties.cmake.in"
|
configure_file("${CMAKE_SOURCE_DIR}/CPackProperties.cmake.in"
|
||||||
"${CPACK_BINARY_DIR}/CPackProperties.cmake" @ONLY)
|
"${CPACK_BINARY_DIR}/CPackProperties.cmake" @ONLY)
|
||||||
|
endif (GENERATE_OTTDREV)
|
||||||
|
|
Loading…
Reference in New Issue