You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
duckstation/.github/workflows/windows-build.yml

127 lines
4.4 KiB
YAML

name: 💻 Windows
on:
workflow_call:
workflow_dispatch:
jobs:
windows-build:
name: "${{ matrix.name }}"
runs-on: windows-2022
timeout-minutes: 120
strategy:
matrix:
include:
- name: "x64"
arch: "x64"
vcvars: "x64"
config: "ReleaseLTCG-Clang"
platform: "x64"
bindir: "x64"
assetname: "duckstation-windows-x64-release.zip"
updatername: "updater-x64-ReleaseLTCG.exe"
- name: "x64 SSE2"
arch: "x64-sse2"
vcvars: "x64"
config: "ReleaseLTCG-Clang-SSE2"
platform: "x64"
bindir: "x64"
assetname: "duckstation-windows-x64-sse2-release.zip"
updatername: "updater-x64-ReleaseLTCG-SSE2.exe"
- name: "ARM64"
arch: "arm64"
vcvars: "amd64_arm64"
config: "ReleaseLTCG-Clang"
platform: "ARM64"
bindir: "ARM64"
assetname: "duckstation-windows-arm64-release.zip"
updatername: "updater-ARM64-ReleaseLTCG.exe"
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: |
dep/msvc/deps-arm64
dep/msvc/deps-x64
key: deps ${{ hashFiles('scripts/deps/build-dependencies-windows-arm64.bat', 'scripts/deps/build-dependencies-windows-x64.bat', 'scripts/deps/versions') }}
- name: Build x64 Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
env:
DEBUG: 0
run: scripts/deps/build-dependencies-windows-x64.bat
- name: Build ARM64 Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
env:
DEBUG: 0
run: scripts/deps/build-dependencies-windows-arm64.bat
- name: Set Build Tag Asset
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
shell: cmd
run: |
echo #pragma once > src/scmversion/tag.h
echo #define SCM_RELEASE_ASSET "${{ matrix.assetname }}" >> src/scmversion/tag.h
echo #define SCM_RELEASE_TAGS {"latest", "preview"} >> src/scmversion/tag.h
- name: Tag as Preview Release
if: github.ref == 'refs/heads/master'
shell: cmd
run: |
echo #define SCM_RELEASE_TAG "preview" >> src/scmversion/tag.h
- name: Tag as Rolling Release Build
if: github.ref == 'refs/heads/dev'
shell: cmd
run: |
echo #define SCM_RELEASE_TAG "latest" >> src/scmversion/tag.h
- name: Update RC Version Fields
shell: cmd
run: |
cd src\scmversion
call update_rc_version.bat
cd ..\..
git update-index --assume-unchanged src/duckstation-qt/duckstation-qt.rc
- name: Download Patch Archives
shell: cmd
run: |
cd data/resources
curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/chtdb/releases/download/latest/cheats.zip"
curl --retry 5 --retry-all-errors -LO "https://github.com/duckstation/chtdb/releases/download/latest/patches.zip"
- name: Compile ${{ matrix.name }} Release Build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.vcvars }}
msbuild duckstation.sln -t:Build -p:Platform=${{ matrix.platform }};Configuration=${{ matrix.config }}
- name: Create ${{ matrix.name }} Symbols Archive
shell: cmd
run: |
"C:\Program Files\7-Zip\7z.exe" a -mx9 -r duckstation-windows-${{ matrix.arch }}-release-symbols.zip ./bin/${{ matrix.bindir }}/*.pdb
- name: Remove Extra Bloat Before Archiving
shell: cmd
run: |
del /Q bin\${{ matrix.bindir }}\*.pdb bin\${{ matrix.bindir }}\*.exp bin\${{ matrix.bindir }}\*.lib bin\${{ matrix.bindir }}\*.iobj bin\${{ matrix.bindir }}\*.ipdb bin\${{ matrix.bindir }}\common-tests*
rename bin\${{ matrix.bindir }}\${{ matrix.updatername }} updater.exe
- name: Create ${{ matrix.name }} Release Archive
shell: cmd
run: |
"C:\Program Files\7-Zip\7z.exe" a -mx9 -r ${{ matrix.assetname }} ./bin/${{ matrix.bindir }}/*
- name: Upload ${{ matrix.name }} Release Artifact
uses: actions/upload-artifact@v4
with:
name: "windows-${{ matrix.arch }}"
path: "duckstation-windows-${{ matrix.arch }}-*.zip"