根据Projects增加功能 #114
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: 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 |