Merge remote-tracking branch 'upstream/master' into 13.0

This commit is contained in:
Pavel Stupnikov
2022-11-26 22:16:25 +04:00
508 changed files with 14617 additions and 9750 deletions

View File

@@ -20,10 +20,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /emsdk/upstream/emscripten/cache
key: 2.0.31-${{ runner.os }}
@@ -91,7 +91,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install dependencies
run: |
@@ -167,15 +167,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Prepare cache key
id: key
run: |
echo "::set-output name=image::$ImageOS-$ImageVersion"
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /usr/local/share/vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
@@ -246,7 +246,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Prepare cache key
id: key
@@ -255,10 +255,10 @@ jobs:
# Work around caching failure with GNU tar
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
Write-Output "::set-output name=image::$env:ImageOS-$env:ImageVersion"
Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
@@ -341,7 +341,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
@@ -411,4 +411,4 @@ jobs:
steps:
- name: Check annotations
uses: OpenTTD/actions/annotation-check@v2
uses: OpenTTD/actions/annotation-check@v3

View File

@@ -10,7 +10,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 4

View File

@@ -31,7 +31,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.sha }}
@@ -41,7 +41,7 @@ jobs:
git checkout -b ${name}
- name: Setup cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /emsdk/upstream/emscripten/cache
key: 2.0.31-${{ runner.os }}

View File

@@ -59,7 +59,7 @@ jobs:
- if: steps.core_developer.outcome == 'success'
name: Trigger 'preview build'
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
event-type: "Preview build #${{ github.event.number }}"

View File

@@ -59,7 +59,7 @@ jobs:
- if: toJson(fromJson(steps.earlier_preview.outputs.data)) != '[]' && contains(fromJson(steps.preview_label.outputs.data).*.name, 'preview')
name: Trigger 'preview build'
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
event-type: "Preview build #${{ github.event.number }}"

View File

@@ -29,14 +29,14 @@ jobs:
steps:
- name: Checkout (Release)
if: github.event_name == 'release'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# We generate a changelog; for this we need the full git log.
fetch-depth: 0
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref }}
# We generate a changelog; for this we need the full git log.
@@ -44,7 +44,7 @@ jobs:
- name: Checkout (Trigger)
if: github.event_name == 'repository_dispatch'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.ref }}
# We generate a changelog; for this we need the full git log.
@@ -138,10 +138,10 @@ jobs:
echo "Folder on CDN: ${FOLDER}"
echo "Workflow trigger: ${TRIGGER_TYPE}"
echo "::set-output name=version::$(cat .version)"
echo "::set-output name=is_tag::${IS_TAG}"
echo "::set-output name=folder::${FOLDER}"
echo "::set-output name=trigger_type::${TRIGGER_TYPE}"
echo "version=$(cat .version)" >> $GITHUB_OUTPUT
echo "is_tag=${IS_TAG}" >> $GITHUB_OUTPUT
echo "folder=${FOLDER}" >> $GITHUB_OUTPUT
echo "trigger_type=${TRIGGER_TYPE}" >> $GITHUB_OUTPUT
env:
NIGHTLIES_BRANCH: master
FOLDER_RELEASES: citymania-client-releases
@@ -174,14 +174,14 @@ jobs:
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: citymania-client-source
path: build/bundles/*
retention-days: 5
- name: Store source (for other jobs)
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: internal-source
path: source.tar.gz
@@ -197,7 +197,7 @@ jobs:
steps:
- name: Download source
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: internal-source
@@ -260,7 +260,7 @@ jobs:
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: openttd-docs
path: build/bundles/*.tar.xz
@@ -278,7 +278,7 @@ jobs:
steps:
- name: Download source
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: internal-source
@@ -344,25 +344,25 @@ jobs:
cmake --build . -j $(nproc)
echo "::endgroup::"
# - name: Create bundles
# run: |
# cd ${GITHUB_WORKSPACE}/build
# echo "::group::Run CPack"
# cpack
# echo "::endgroup::"
# echo "::group::Cleanup"
# # Remove the sha256 files CPack generates; we will do this ourself at
# # the end of this workflow.
# rm -f bundles/*.sha256
# echo "::endgroup::"
# - name: Store bundles
# uses: actions/upload-artifact@v2
# with:
# name: openttd-linux-generic
# path: build/bundles
# retention-days: 5
# - name: Create bundles
# run: |
# cd ${GITHUB_WORKSPACE}/build
# echo "::group::Run CPack"
# cpack
# echo "::endgroup::"
#
# echo "::group::Cleanup"
# # Remove the sha256 files CPack generates; we will do this ourself at
# # the end of this workflow.
# rm -f bundles/*.sha256
# echo "::endgroup::"
#
# - name: Store bundles
# uses: actions/upload-artifact@v3
# with:
# name: openttd-linux-generic
# path: build/bundles
# retention-days: 5
linux-distro:
name: Linux (Distros)
@@ -374,14 +374,11 @@ jobs:
fail-fast: false
matrix:
include:
- container_image: "ubuntu:18.04"
bundle_name: "bionic"
compiler: "g++-8"
- container_image: "ubuntu:20.04"
bundle_name: "focal"
compiler: "g++"
- container_image: "debian:buster"
bundle_name: "buster"
- container_image: "ubuntu:22.04"
bundle_name: "jammy"
compiler: "g++"
- container_image: "debian:bullseye"
bundle_name: "bullseye"
@@ -393,7 +390,7 @@ jobs:
steps:
- name: Download source
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: internal-source
@@ -464,7 +461,7 @@ jobs:
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: openttd-linux-${{ matrix.bundle_name }}
path: build/bundles
@@ -474,13 +471,13 @@ jobs:
name: MacOS
needs: source
runs-on: macos-10.15
runs-on: macos-11
env:
MACOSX_DEPLOYMENT_TARGET: 10.14
steps:
- name: Download source
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: internal-source
@@ -498,10 +495,10 @@ jobs:
- name: Prepare cache key
id: key
run: |
echo "::set-output name=image::$ImageOS-$ImageVersion"
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /usr/local/share/vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-release-1 # Increase the number whenever dependencies are modified
@@ -657,7 +654,7 @@ jobs:
mv _CPack_Packages/*/Bundle/citymania-client-*.zip bundles/
- name: Store bundles
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: citymania-client-macos-universal
path: build-x64/bundles
@@ -682,7 +679,7 @@ jobs:
steps:
- name: Download source
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: internal-source
@@ -703,10 +700,10 @@ jobs:
# Work around caching failure with GNU tar
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
Write-Output "::set-output name=image::$env:ImageOS-$env:ImageVersion"
Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
@@ -855,12 +852,195 @@ jobs:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
- name: Store bundles
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: citymania-client-windows-${{ matrix.arch }}
path: build/bundles
retention-days: 5
windows-appx:
name: Windows Store
needs:
- source
- windows
if: needs.source.outputs.is_tag == 'true'
runs-on: windows-latest
steps:
- name: Download source
uses: actions/download-artifact@v3
with:
name: internal-source
- name: Unpack source
shell: bash
run: |
tar -xf source.tar.gz --strip-components=1
- name: Download x86 build
uses: actions/download-artifact@v3
with:
name: openttd-windows-x86
- name: Download x64 build
uses: actions/download-artifact@v3
with:
name: openttd-windows-x64
- name: Download arm64 build
uses: actions/download-artifact@v3
with:
name: openttd-windows-arm64
- name: Unpack builds
shell: bash
run: |
mkdir builds
cd builds
function extract {
mkdir $1
# Extract the zip version of the release
unzip ../openttd-*-windows-$2.zip -d $1
# Remove the extraneous directory
mv $1/openttd-*-windows-$2/* $1/
rmdir $1/openttd-*-windows-$2
# Move the openttd.exe to the '{arch}-binaries' folder
mkdir $1-binaries
mv $1/openttd.exe $1-binaries/
}
extract x86 win32
extract x64 win64
extract arm64 arm64
# Use the "x86" folder as the source of the common binaries (lang files, etc) and remove the others
mv x86 common-binaries
rm -rf x64 arm64
- name: Install OpenGFX
shell: bash
run: |
mkdir -p builds/common-binaries/baseset
cd builds/common-binaries/baseset
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/7.1/opengfx-7.1-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
tar xf opengfx-*.tar
echo "::endgroup::"
rm -f opengfx-all.zip opengfx-*.tar
- name: Install OpenMSX
shell: bash
run: |
mkdir -p builds/common-binaries/baseset
cd builds/common-binaries/baseset
echo "::group::Download OpenMSX"
curl -L https://cdn.openttd.org/openmsx-releases/0.4.2/openmsx-0.4.2-all.zip -o openmsx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip openmsx-all.zip
tar xf openmsx-*.tar
echo "::endgroup::"
rm -f openmsx-all.zip openmsx-*.tar
- name: Install OpenSFX
shell: bash
run: |
mkdir -p builds/common-binaries/baseset/opensfx
cd builds/common-binaries/baseset/opensfx
echo "::group::Download OpenSFX"
curl -L https://cdn.openttd.org/opensfx-releases/1.0.3/opensfx-1.0.3-all.zip -o opensfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenSFX"
unzip opensfx-all.zip
tar xf opensfx-*.tar
echo "::endgroup::"
rm -f opensfx-all.zip opensfx-*.tar
- name: Generate signing certificate
shell: cmd
run: |
cd builds
REM We need to provide a signed .appx to the Windows Store, so generate a certificate with password 'password'
call ..\os\windows\winstore\generate-key.bat "CN=78024DA8-4BE4-4C77-B12E-547BBF7359D2" password cert.pfx
- name: Generate assets
shell: cmd
run: |
cd os\windows\winstore
call generate-assets.bat
- name: Prepare manifests
shell: cmd
run: |
cd builds
mkdir manifests
REM Set the version environment variable
call ..\os\windows\winstore\set-version.bat x86-binaries\openttd.exe
call ..\os\windows\winstore\prepare-manifests.bat manifests "CN=78024DA8-4BE4-4C77-B12E-547BBF7359D2" "57420OpenTTDDevelopers.OpenTTDofficial"
- name: Prepare binaries
shell: bash
run: |
cd builds
# Copy the Windows Store assets
mkdir common-binaries/Assets
cp -R ../os/windows/winstore/assets-common/* common-binaries/Assets/
mkdir Assets
cp -R ../os/windows/winstore/assets/* Assets/
cp manifests/*.xml .
- name: Build
shell: cmd
run: |
REM Add the Windows SDK tools to the PATH
echo|set /p="SET VS_INSTALLDIR=" > _vspath.bat
vswhere -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath >> _vspath.bat
call _vspath.bat
call "%VS_INSTALLDIR%\Common7\Tools\VsDevCmd.bat"
REM Set the version environment variable
call os\windows\winstore\set-version.bat builds\x86-binaries\openttd.exe
cd builds
mkdir output
REM Build and sign the package
makeappx build /v /f PackagingLayout.xml /op output\ /bv %OTTD_VERSION% /pv %OTTD_VERSION% /ca
SignTool sign /fd sha256 /a /f cert.pfx /p password "output\OpenTTD.appxbundle"
- name: Store appx
uses: actions/upload-artifact@v3
with:
name: openttd-windows-store
path: |
builds/output/OpenTTD.appxbundle
builds/cert.pfx
retention-days: 5
upload:
name: Upload (AWS)
needs:
@@ -882,7 +1062,7 @@ jobs:
steps:
- name: Download all bundles
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
- name: Calculate checksums
run: |
@@ -914,7 +1094,7 @@ jobs:
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
- name: Trigger 'New OpenTTD release'
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.DEPLOYMENT_TOKEN }}
repository: OpenTTD/workflows
@@ -935,7 +1115,7 @@ jobs:
steps:
- name: Download all bundles
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
- name: Setup steamcmd
uses: CyberAndrii/setup-steamcmd@v1
@@ -1051,4 +1231,4 @@ jobs:
port: ${{ secrets.UPLOAD_PORT }}
source: "citymania-client-*/*.zip,citymania-client-*/*.xz,citymania-client-*/*.dmg"
strip_components: 1
target: ${{ secrets.UPLOAD_PATH }}
target: ${{ secrets.UPLOAD_PATH }}

View File

@@ -10,7 +10,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Check for unused strings
run: |