Remove: [Azure Pipelines] So Long, and Thanks for All the Fish

Azure Pipelines has build our releases for two years now, but we
are finally switching to GitHub Actions. This to bring the full
workflow to a single place, making it easier for people to see
what is going on and how to influence the process.

(cherry picked from commit de614131e4)
pull/211/head
Patric Stout 4 years ago committed by Jonathan G Rennison
parent 4714fea258
commit 020430529e

@ -1,10 +0,0 @@
trigger:
branches:
include:
- refs/tags/*
pr: none
jobs:
- template: azure-pipelines/templates/release.yml
parameters:
IsStableRelease: true

@ -1,7 +0,0 @@
trigger: none
pr: none
jobs:
- template: azure-pipelines/templates/release.yml
parameters:
IsStableRelease: false

@ -1,16 +0,0 @@
#!/bin/sh
tag=$(git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null | sed 's@\^0$@@')
# If we are a tag, show the part of the changelog till (but excluding) the last stable
if [ -n "$tag" ]; then
grep='^[0-9]\+\.[0-9]\+\.[0-9]\+[^-]'
next=$(cat changelog.txt | grep '^[0-9]' | awk 'BEGIN { show="false" } // { if (show=="true") print $0; if ($1=="'$tag'") show="true"} ' | grep "$grep" | head -n1 | sed 's/ .*//')
cat changelog.txt | awk 'BEGIN { show="false" } /^[0-9]+.[0-9]+.[0-9]+/ { if ($1=="'$next'") show="false"; if ($1=="'$tag'") show="true";} // { if (show=="true") print $0 }'
exit 0
fi
# In all other cases, show the git log of the last 7 days
revdate=$(git log -1 --pretty=format:"%ci")
last_week=$(date -d "$revdate -7days" +"%Y-%m-%d %H:%M")
git log --after="${last_week}" --pretty=fuller

@ -1,87 +0,0 @@
#!/bin/sh
set -ex
if [ -z "$1" ]; then
echo "Usage: $0 <folder-with-bundles>"
exit 1
fi
FOLDER=$1
if [ ! -e .version ] || [ ! -e .release_date ]; then
echo "This script should be executed in the root of an extracted source tarball"
exit 1
fi
# Find the name based on the version
if [ -e .is_stable ]; then
isTesting=$(cat .version | grep "RC\|beta" || true)
if [ -z "${isTesting}" ]; then
NAME="stable"
else
NAME="testing"
fi
else
NAME=$(cat .version | cut -d- -f2 | cut -d- -f-2)
fi
# Convert the date to a YAML date
DATE=$(cat .release_date | tr ' ' T | sed 's/TUTC/:00-00:00/')
VERSION=$(cat .version)
BASE="openttd-${VERSION}"
echo "name: ${NAME}" > manifest.yaml
echo "date: ${DATE}" >> manifest.yaml
echo "base: ${BASE}-" >> manifest.yaml
error=""
FILES=
DEV_FILES=
for filename in $(ls ${FOLDER} | grep -v ".txt$\|.md$\|sum$" | sort); do
case ${filename} in
*docs* |\
*source* |\
*dbg.deb |\
*pdb.xz )
DEV_FILES="${DEV_FILES} ${filename}"
;;
*)
FILES="${FILES} ${filename}"
;;
esac
done
# output_files key filename...
output_files() {
if [ "$#" -lt 2 ]; then return; fi
key=$1
echo "${key}:" >> manifest.yaml
shift
while [ "$#" -gt 0 ]; do
filename=$1
if [ ! -e ${FOLDER}/${filename}.md5sum ] || [ ! -e ${FOLDER}/${filename}.sha1sum ] || [ ! -e ${FOLDER}/${filename}.sha256sum ]; then
echo "ERROR: missing checksum file for ${filename}" 1>&2
error="y"
shift
continue
fi
echo "- id: ${filename}" >> manifest.yaml
echo " size: $(stat -c"%s" ${FOLDER}/${filename})" >> manifest.yaml
echo " md5sum: $(cat ${FOLDER}/${filename}.md5sum | cut -d\ -f1)" >> manifest.yaml
echo " sha1sum: $(cat ${FOLDER}/${filename}.sha1sum | cut -d\ -f1)" >> manifest.yaml
echo " sha256sum: $(cat ${FOLDER}/${filename}.sha256sum | cut -d\ -f1)" >> manifest.yaml
shift
done
}
output_files files ${FILES}
output_files dev_files ${DEV_FILES}
if [ -n "${error}" ]; then
echo "ERROR: exiting due to earlier errors" 1>&2
exit 1
fi

@ -1,39 +0,0 @@
parameters:
Image: ''
Tag: ''
ContainerCommand: ''
steps:
# 'envVars' in the 'Docker@1' task is a bit funky. When you want to use a
# variable, you have to quote it. But the quote is also sent directly to
# Docker and ends up in the variable, which you don't want. To work around
# this, we set the correct variable first (which becomes an env-variable), and
# pass that env-variable through to Docker. We cannot use the normal
# 'variables' entry, as we are a template. So that results in this bit of
# Bash code. Not because it is pretty, but it is the only way we found that
# works.
- bash: |
echo "##vso[task.setvariable variable=TARGET_BRANCH]${SYSTEM_PULLREQUEST_TARGETBRANCH}"
echo "Target branch is ${SYSTEM_PULLREQUEST_TARGETBRANCH}"
displayName: "Set target branch"
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
- task: Docker@1
${{ if eq(parameters.Image, 'compile-farm') }}:
displayName: 'Build'
${{ if eq(parameters.Image, 'compile-farm-ci') }}:
displayName: 'Build and test'
# Run the commit-checker only if it is a Pull Request
condition: and(succeeded(), or(not(contains(variables['Agent.JobName'], 'commit-checker')), eq(variables['Build.Reason'], 'PullRequest')))
inputs:
command: 'Run an image'
imageName: openttd/${{ parameters.Image }}:${{ parameters.Tag }}
volumes: |
$(Build.SourcesDirectory):$(Build.SourcesDirectory)
/usr/local/share/games/openttd:/usr/local/share/games/openttd
workingDirectory: '$(Build.SourcesDirectory)'
containerCommand: ${{ parameters.ContainerCommand }}
runInBackground: false
envVars: |
TARGET_BRANCH
CTEST_OUTPUT_ON_FAILURE=1

@ -1,5 +0,0 @@
steps:
# 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.
- bash: sudo chown -R $(id -u):$(id -g) build/bundles
displayName: 'Claim bundles folder back'

@ -1,9 +0,0 @@
steps:
- script: |
set -ex
mkdir build
cd build
cmake ..
make -j2
displayName: 'Build'

@ -1,5 +0,0 @@
steps:
- script: |
set -ex
HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config lzo xz libpng freetype
displayName: 'Install dependencies'

@ -1,26 +0,0 @@
parameters:
CalculateChecksums: true
steps:
- ${{ if eq(parameters.CalculateChecksums, true) }}:
- bash: |
set -ex
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
openssl dgst -r -md5 -hex $i > $i.md5sum
openssl dgst -r -sha1 -hex $i > $i.sha1sum
openssl dgst -r -sha256 -hex $i > $i.sha256sum
done
displayName: 'Calculate checksums'
- task: PublishBuildArtifacts@1
displayName: 'Publish bundles'
inputs:
PathtoPublish: build/bundles/
ArtifactName: bundles

@ -1,20 +0,0 @@
# Fetch the source tarball as prepared by an earlier job. In there is the
# version predefined. This ensures we are all going to compile the same
# source with the same version.
steps:
- checkout: none
- task: DownloadBuildArtifacts@0
displayName: 'Download source'
inputs:
downloadType: specific
itemPattern: 'bundles/openttd-*-source.tar.xz'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- bash: tar --xz -xf ../a/bundles/openttd-*-source.tar.xz --strip-components=1
displayName: 'Extracting source'
- bash: |
set -e
VERSION=$(cat .version)
echo "${VERSION}"
echo "##vso[build.updatebuildnumber]${VERSION}"
displayName: 'Change BuildNumber to version'

@ -1,20 +0,0 @@
parameters:
IsStableRelease: false
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download all bundles'
inputs:
downloadType: specific
itemPattern: 'bundles/*'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- ${{ if eq(parameters.IsStableRelease, true) }}:
- script: |
touch .is_stable
displayName: 'Mark as stable release'
- script: |
set -ex
./azure-pipelines/manifest.sh ../a/bundles/
mkdir -p build/bundles
mv manifest.yaml build/bundles/
displayName: 'Create manifest.yaml'

@ -1,37 +0,0 @@
# Set the revisions, and remove the VCS files.
# This ensures everything else picks up on the predefined versions, and not
# that because of some build process the version all of a sudden changes.
steps:
- script: |
set -ex
if [ -n "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}" ]; then
# We are triggered from a GitHub Pull Request
git checkout -B pr${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}
elif [ "${BUILD_SOURCEBRANCHNAME}" = "merge" ] || [ "${BUILD_SOURCEBRANCHNAME}" = "head" ]; then
# We are manually triggered based on a GitHub Pull Request
PULLREQUESTNUMBER=$(echo ${BUILD_SOURCEBRANCH} | cut -d/ -f3)
git checkout -B pr${PULLREQUESTNUMBER}
else
git checkout -B ${BUILD_SOURCEBRANCHNAME}
fi
# Generate .ottdrev, which contains the version information
cmake -DGENERATE_OTTDREV=.ottdrev -P cmake/scripts/FindVersion.cmake
./azure-pipelines/changelog.sh > .changelog
TZ='UTC' date +"%Y-%m-%d %H:%M UTC" > .release_date
cat .ottdrev | cut -f 1 -d$'\t' > .version
echo "Release Date: $(cat .release_date)"
echo "Revision: $(cat .ottdrev)"
echo "Version: $(cat .version)"
displayName: 'Create version files'
- script: |
set -e
VERSION=$(cat .version)
echo "${VERSION}"
echo "##vso[build.updatebuildnumber]${VERSION}"
displayName: 'Change BuildNumber to version'
- script: find . -iname .hg -or -iname .git -or -iname .svn | xargs rm -rf
displayName: 'Remove VCS information'

@ -1,193 +0,0 @@
parameters:
# If this is false, not all targets are triggered. For example:
# The NSIS installer for Windows and the creation of debs only work for
# releases. Not for any other type of binary. So they are skilled if this
# is set to false.
IsStableRelease: false
jobs:
- job: source
displayName: 'Source'
pool:
vmImage: 'ubuntu-16.04'
steps:
- template: release-prepare-source.yml
- script: |
set -ex
# Rename the folder to openttd-NNN-source
mkdir openttd-$(Build.BuildNumber)
find . -maxdepth 1 -not -name . -not -name openttd-$(Build.BuildNumber) -exec mv {} openttd-$(Build.BuildNumber)/ \;
# Copy back release_date, as it is needed for the template 'release-bundles'
cp openttd-$(Build.BuildNumber)/.release_date .release_date
mkdir -p build/bundles
tar --xz -cf build/bundles/openttd-$(Build.BuildNumber)-source.tar.xz openttd-$(Build.BuildNumber)
zip -9 -r -q build/bundles/openttd-$(Build.BuildNumber)-source.zip openttd-$(Build.BuildNumber)
displayName: 'Create bundle'
- template: release-bundles.yml
- job: meta
displayName: 'Metadata'
pool:
vmImage: 'ubuntu-16.04'
dependsOn: source
steps:
- template: release-fetch-source.yml
- script: |
set -ex
mkdir -p build/bundles
cp .changelog build/bundles/changelog.txt
cp .release_date build/bundles/released.txt
cp README.md build/bundles/README.md
displayName: 'Copy meta files'
- template: release-bundles.yml
parameters:
CalculateChecksums: false
- job: docs
displayName: 'Docs'
pool:
vmImage: 'ubuntu-16.04'
dependsOn: source
steps:
- template: release-fetch-source.yml
- template: linux-build.yml
parameters:
Image: compile-farm
ContainerCommand: '$(Build.BuildNumber)'
Tag: docs
- template: linux-claim-bundles.yml
- template: release-bundles.yml
- job: windows
displayName: 'Windows'
pool:
vmImage: 'VS2017-Win2016'
dependsOn: source
strategy:
matrix:
Win32:
BundlePlatform: 'win32'
BuildArch: 'Win32'
VcpkgTargetTriplet: 'x86-windows-static'
Win64:
BundlePlatform: 'win64'
BuildArch: 'x64'
VcpkgTargetTriplet: 'x64-windows-static'
steps:
- template: release-fetch-source.yml
- template: windows-dependencies.yml
- template: windows-dependency-zip.yml
- template: windows-build.yml
parameters:
BuildArch: $(BuildArch)
VcpkgTargetTriplet: $(VcpkgTargetTriplet)
BuildConfiguration: 'RelWithDebInfo'
${{ if eq(parameters.IsStableRelease, true) }}:
OptionUseNSIS: "ON"
- task: VSBuild@1
displayName: 'Create bundles'
inputs:
solution: build/PACKAGE.vcxproj
configuration: 'RelWithDebInfo'
- bash: |
set -ex
cp build/RelWithDebInfo/openttd.pdb build/bundles/openttd-$(Build.BuildNumber)-windows-$(BundlePlatform).pdb
xz -9 build/bundles/openttd-$(Build.BuildNumber)-windows-$(BundlePlatform).pdb
displayName: 'Copy PDB to bundles folder'
- template: release-bundles.yml
- ${{ if eq(parameters.IsStableRelease, true) }}:
- job: linux_stable
displayName: 'Linux'
pool:
vmImage: 'ubuntu-16.04'
dependsOn: source
strategy:
matrix:
linux-ubuntu-xenial-i386-gcc:
Tag: 'linux-ubuntu-xenial-i386-gcc'
linux-ubuntu-xenial-amd64-gcc:
Tag: 'linux-ubuntu-xenial-amd64-gcc'
linux-ubuntu-bionic-i386-gcc:
Tag: 'linux-ubuntu-bionic-i386-gcc'
linux-ubuntu-bionic-amd64-gcc:
Tag: 'linux-ubuntu-bionic-amd64-gcc'
linux-ubuntu-focal-amd64-gcc:
Tag: 'linux-ubuntu-focal-amd64-gcc'
linux-debian-stretch-i386-gcc:
Tag: 'linux-debian-stretch-i386-gcc'
linux-debian-stretch-amd64-gcc:
Tag: 'linux-debian-stretch-amd64-gcc'
linux-debian-buster-i386-gcc:
Tag: 'linux-debian-buster-i386-gcc'
linux-debian-buster-amd64-gcc:
Tag: 'linux-debian-buster-amd64-gcc'
steps:
- template: release-fetch-source.yml
- template: linux-build.yml
parameters:
Image: compile-farm
ContainerCommand: '$(Build.BuildNumber)'
Tag: $(Tag)
- template: linux-claim-bundles.yml
- template: release-bundles.yml
- job: macos
displayName: 'MacOS'
pool:
vmImage: 'macOS-10.14'
dependsOn: source
variables:
MACOSX_DEPLOYMENT_TARGET: 10.9
steps:
- template: release-fetch-source.yml
- template: osx-dependencies.yml
- template: osx-build.yml
- script: |
set -ex
cd build
make package
displayName: 'Create bundles'
- template: release-bundles.yml
- job: manifest
displayName: 'Manifest'
pool:
vmImage: 'ubuntu-16.04'
dependsOn:
- source
- docs
- windows
- ${{ if eq(parameters.IsStableRelease, true) }}:
- linux_stable
- macos
# "Skipped" is not a status, and is not succeeded. So it seems to be
# considered failed. So we trigger if all the earlier jobs are done (which
# might be succeeded, failed, or skipped), and run this job. This is not
# optimal, but given the rules, it is the only way to get this to work (as
# some jobs might be skipped).
condition: succeededOrFailed()
steps:
- template: release-fetch-source.yml
- template: release-manifest.yml
${{ if eq(parameters.IsStableRelease, true) }}:
parameters:
IsStableRelease: true
- template: release-bundles.yml
parameters:
CalculateChecksums: false

@ -1,17 +0,0 @@
parameters:
BuildArch: ''
VcpkgTargetTriplet: ''
BuildConfiguration: ''
OptionUseNSIS: 'OFF'
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 }}" -DOPTION_USE_NSIS="${{ parameters.OptionUseNSIS }}"'
- task: VSBuild@1
displayName: 'Build'
inputs:
solution: build/openttd.vcxproj
configuration: ${{ parameters.BuildConfiguration }}
maximumCpuCount: true

@ -1,14 +0,0 @@
steps:
- bash: |
set -ex
curl -L https://github.com/OpenTTD/CompileFarm/releases/download/latest/windows-dependencies.zip > windows-dependencies.zip
unzip windows-dependencies.zip
rm -f windows-dependencies.zip
mv windows-dependencies/installed /c/vcpkg/
rm -rf windows-dependencies
displayName: 'Install dependencies'
workingDirectory: $(Build.ArtifactStagingDirectory)
- script: c:\vcpkg\vcpkg.exe integrate install
displayName: 'Integrate vcpkg'

@ -1,5 +0,0 @@
steps:
- bash: |
set -ex
choco install zip
displayName: 'Install zip'
Loading…
Cancel
Save