Files
@ r28520:f9aebe299cae
Branch filter:
Location: cpp/openttd-patchpack/source/.github/workflows/release-windows.yml - annotation
r28520:f9aebe299cae
6.4 KiB
text/x-yaml
Codechange: MacOS already has MIN/MAX macros defined
This is caused because we use PreCompile Headers, and one of them
includes a system headers which defines MIN/MAX.
This is caused because we use PreCompile Headers, and one of them
includes a system headers which defines MIN/MAX.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r27371:b9ad4c1bff08 r27371:b9ad4c1bff08 r27371:b9ad4c1bff08 r27371:b9ad4c1bff08 r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r27200:30cdfc56c515 r27178:0b71cae1d77a r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r28360:bb1633c75235 r28360:bb1633c75235 r28360:bb1633c75235 r28360:bb1633c75235 r28360:bb1633c75235 r28360:bb1633c75235 r28360:bb1633c75235 r28360:bb1633c75235 r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r27841:362bf679e5ea r26825:39b775cd7fbd r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r27371:b9ad4c1bff08 r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r27227:fb6db1b1e1a6 r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r27371:b9ad4c1bff08 r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r27227:fb6db1b1e1a6 r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r26825:39b775cd7fbd r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea r27841:362bf679e5ea | name: Release (Windows)
on:
workflow_call:
inputs:
survey_key:
required: false
type: string
default: ""
is_tag:
required: true
type: string
jobs:
windows:
strategy:
fail-fast: false
matrix:
include:
- arch: x86
host: x86
- arch: x64
host: x64
- arch: arm64
host: x64_arm64
name: Windows (${{ matrix.arch }})
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: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
- name: Setup vcpkg caching
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install dependencies
shell: bash
run: |
echo "::group::Install choco dependencies"
choco install pandoc
echo "::endgroup::"
echo "::group::Install breakpad dependencies"
cargo install dump_syms
echo "::endgroup::"
- name: Install MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master
- name: Configure developer command prompt for tools
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Build tools
shell: bash
run: |
mkdir build-host
cd build-host
echo "::group::CMake"
cmake ${GITHUB_WORKSPACE} \
-GNinja \
-DOPTION_TOOLS_ONLY=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build . --target tools
echo "::endgroup::"
- name: Configure developer command prompt for ${{ matrix.arch }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.host }}
- name: Import code signing certificate
shell: powershell
# If this is run on a fork, there may not be a certificate set up - continue in this case
continue-on-error: true
run: |
$tempFile = [System.IO.Path]::GetTempFileName()
$bytes = [System.Convert]::FromBase64String($env:WINDOWS_CERTIFICATE_P12)
[IO.File]::WriteAllBytes($tempFile, $bytes)
$pwd = ConvertTo-SecureString $env:WINDOWS_CERTIFICATE_PASSWORD -AsPlainText -Force
Import-PfxCertificate -FilePath $tempFile -CertStoreLocation Cert:\CurrentUser\My -Password $pwd
Remove-Item $tempFile
env:
WINDOWS_CERTIFICATE_P12: ${{ secrets.WINDOWS_CERTIFICATE_P12 }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
- name: Build (with installer)
if: inputs.is_tag == 'true'
shell: bash
run: |
mkdir build
cd build
echo "::group::CMake"
cmake ${GITHUB_WORKSPACE} \
-GNinja \
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \
-DOPTION_USE_NSIS=ON \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DWINDOWS_CERTIFICATE_COMMON_NAME="${WINDOWS_CERTIFICATE_COMMON_NAME}" \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build . --target openttd
echo "::endgroup::"
env:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
- name: Build (without installer)
if: inputs.is_tag != 'true'
shell: bash
run: |
mkdir build
cd build
echo "::group::CMake"
cmake ${GITHUB_WORKSPACE} \
-GNinja \
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DWINDOWS_CERTIFICATE_COMMON_NAME="${WINDOWS_CERTIFICATE_COMMON_NAME}" \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build . --target openttd
echo "::endgroup::"
env:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
- name: Create breakpad symbols
shell: bash
run: |
cd build
dump_syms openttd.pdb --inlines --store symbols
- name: Create bundles
shell: bash
run: |
cd ${GITHUB_WORKSPACE}/build
echo "::group::Run CPack"
cpack
echo "::endgroup::"
echo "::group::Move PDB and exe to symbols"
PDB_FOLDER=$(find symbols -mindepth 2 -type d)
cp openttd.pdb ${PDB_FOLDER}/
EXE_FOLDER=symbols/openttd.exe/$(grep "INFO CODE_ID" symbols/*/*/openttd.sym | cut -d\ -f3)
mkdir -p ${EXE_FOLDER}
cp openttd.exe ${EXE_FOLDER}/
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: Sign installer
if: inputs.is_tag == 'true'
shell: bash
# If this is run on a fork, there may not be a certificate set up - continue in this case
continue-on-error: true
run: |
cd ${GITHUB_WORKSPACE}/build/bundles
../../os/windows/sign.bat *.exe "${WINDOWS_CERTIFICATE_COMMON_NAME}"
env:
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
- name: Store bundles
uses: actions/upload-artifact@v3
with:
name: openttd-windows-${{ matrix.arch }}
path: build/bundles
retention-days: 5
- name: Store symbols
uses: actions/upload-artifact@v3
with:
name: symbols-windows-${{ matrix.arch }}
path: build/symbols
retention-days: 5
|