fix(app): 修复涉及游戏列表更改时可能抛出COMException异常的问题 #160
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: build | |
on: | |
push: | |
branches: | |
- dev | |
paths: | |
- 'GalgameManager/**' | |
- 'GalgameManager.Core/**' | |
- 'GalgameManager.Server/**' | |
- 'GalgameManager.Test/**' | |
pull_request: | |
paths: | |
- 'GalgameManager/**' | |
- 'GalgameManager.Core/**' | |
- 'GalgameManager.Server/**' | |
- 'GalgameManager.Test/**' | |
jobs: | |
build: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
platform: ["x86", "x64", "ARM64"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Setup MSBuild.exe | |
uses: microsoft/setup-msbuild@v2 | |
- name: Update version | |
shell: pwsh | |
run: | | |
$manifestPath = "GalgameManager/Package.appxmanifest" | |
[xml]$manifest = Get-Content $manifestPath | |
$version = $manifest.Package.Identity.Version | |
$versionParts = $version.Split('.') | |
$versionParts[3] = [string]([int]$versionParts[3] + 1) | |
$versionParts[3] = $env:GITHUB_RUN_NUMBER | |
$newVersion = [string]::Join('.', $versionParts) | |
$manifest.Package.Identity.Version = $newVersion | |
$manifest.Save($manifestPath) | |
echo "Updated version to $newVersion" | |
- name: Update app icon | |
shell: pwsh | |
run: | | |
xcopy "GalgameManager\Assets\Pictures\icon-dev\*" "GalgameManager\Assets\" /s /e /y | |
echo "Updated app icon" | |
- name: Create the app package | |
run: msbuild GalgameManager\GalgameManager.csproj /restore "/p:Platform=${{ matrix.platform }};Configuration=Release;UapAppxPackageBuildMode=SideloadOnly;AppxPackageDir=..\publish\;GenerateAppxPackageOnBuild=true;AppxPackageSigningEnabled=true;PackageCertificateKeyFile=GalgameManager_TemporaryKey.pfx" | |
- name: Move package | |
shell: pwsh | |
run: | | |
# 将 msix 和 cer 移动到 publish 根目录 | |
$subFolder = Get-ChildItem -Path publish -Directory | Select-Object -First 1 | |
$msixFile = Get-ChildItem -Path $subFolder.FullName -Filter "*.msix" -File | Select-Object -First 1 | |
$cerFile = Get-ChildItem -Path $subFolder.FullName -Filter "*.cer" -File | Select-Object -First 1 | |
if ($msixFile -and $cerFile) { Move-Item $msixFile.FullName, $cerFile.FullName -Destination publish -Force } | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: PotatoVN-${{ matrix.platform }}-sideload | |
path: | | |
publish/*.msix | |
publish/*.cer |