This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
suyu-windows-build #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: suyu-windows-build | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'select branch to build(default: dev)' | |
required: false | |
default: 'dev' | |
build-name: | |
description: 'select build-name to build(default: mainline)' | |
required: false | |
default: 'mainline' | |
schedule: | |
- cron: "0 0 */7 * *" | |
jobs: | |
suyu_windows_build: | |
permissions: | |
contents: write | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: main } | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
with: | |
msbuild-architecture: x64 | |
- name: Install Vulkan SDK | |
run: | | |
echo $env:date | |
cd ${{ github.workspace }} | |
${{ github.workspace }}/script/install-vulkan-sdk.ps1 | |
- name: Download suyu source code | |
run: | | |
cd ${{ github.workspace }} | |
git clone --branch ${{ github.event.inputs.branch || 'dev' }} https://git.suyu.dev/suyu/suyu.git --recursive | |
- name: Get date | |
id: version | |
shell: pwsh | |
run: | | |
cd ${{ github.workspace }}\suyu | |
"date=$(date -u "+%Y%m%d")" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
"tag=$(git describe --tags --always)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
- name: Configure CMake | |
run: | | |
cd ${{ github.workspace }}/suyu | |
Import-Module $env:ChocolateyInstall/helpers/chocolateyProfile.psm1 && | |
glslangValidator --version && | |
mkdir build && | |
cd build && | |
cmake -E env CXXFLAGS="/Gw" cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_POLICY_DEFAULT_CMP0069=NEW -DSUYU_ENABLE_LTO=ON -DSUYU_USE_BUNDLED_QT=1 -DSUYU_USE_BUNDLED_SDL2=1 -DSUYU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DSUYU_ENABLE_COMPATIBILITY_REPORTING=ON -DSUYU_TESTS=OFF -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DDISPLAY_VERSION="1.0.0" -DCMAKE_BUILD_TYPE=Release -DSUYU_CRASH_DUMPS=ON .. | |
- name: Build Solution | |
shell: pwsh | |
run: | | |
cd ${{ github.workspace }}/suyu | |
msbuild build/suyu.sln /m /p:Configuration=Release | |
- name: Package Artifacts | |
shell: pwsh | |
run: | | |
cd ${{ github.workspace }}/suyu | |
${{ github.workspace }}/script/upload.ps1 ${{ github.event.inputs.build-name || 'mainline' }} ${{ steps.version.outputs.date }} ${{ steps.version.outputs.tag }} | |
cd ${{ github.workspace }} | |
- name: Release Suyu Windows (Suyu-Windows) | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Suyu Windows ${{ steps.version.outputs.date }} | |
tag_name: suyu-windows | |
files: | | |
suyu*.zip | |
- name: Release Suyu Windows ${{ steps.version.outputs.date }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: ${{ steps.version.outputs.date }} | |
tag_name: ${{ steps.version.outputs.date }} | |
files: | | |
suyu*.zip |