fix: 修复 CommunityToolkit-SettingsControls AOT 崩溃 #174
This file contains hidden or 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 MSIX | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - src/** | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - src/** | |
| workflow_dispatch: | |
| inputs: | |
| is_release: | |
| description: Is Release? | |
| required: true | |
| type: boolean | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| configuration: [Release] | |
| platform: [x64, arm64] | |
| runs-on: | |
| # For a list of available runner types, refer to https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on | |
| windows-latest | |
| env: | |
| DotVast_AppxmanifestPath: src\DotVast.HashTool.WinUI\Package.appxmanifest | |
| DotVast_PfxName: GitHubActionsWorkflow.pfx | |
| DotVast_PfxThumbprint: A87830CE7AA286884D04D11E8FA020CB5A1097C5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Used in `Update appxmanifest version` | |
| - name: Set environment variables | |
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.is_release }} | |
| run: | | |
| "DotVast_CIRelease=True" >> $env:GITHUB_ENV | |
| # Install the .NET Core workload: https://github.com/actions/setup-dotnet | |
| - name: Install .NET Core | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0.x | |
| # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild | |
| - name: Setup MSBuild.exe | |
| uses: microsoft/setup-msbuild@v2 | |
| # 更新 revision 为 github.run_number: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context | |
| - name: Update appxmanifest version | |
| if: ${{ !(github.event_name == 'workflow_dispatch' && inputs.is_release) }} | |
| run: | | |
| $appxmanifestPath = Convert-Path $env:DotVast_AppxmanifestPath | |
| [xml]$appxmanifest = Get-Content $appxmanifestPath | |
| $newVersion = $appxmanifest.Package.Identity.Version -replace ('^(\d+\.\d+\.\d+)\.\d+$', "`$1.${{ github.run_number }}") | |
| $appxmanifest.Package.Identity.Version = $newVersion | |
| $appxmanifest.Save($appxmanifestPath) | |
| # Import the base 64 encoded pfx | |
| - name: Import the pfx | |
| run: | | |
| $pfxCertBytes = [System.Convert]::FromBase64String('${{ secrets.BASE64_ENCODED_PFX }}') | |
| Set-Content -Path $env:DotVast_PfxName -Value $pfxCertBytes -AsByteStream | |
| $password = ConvertTo-SecureString -String '${{ secrets.PFX_PASSWORD }}' -AsPlainText | |
| Import-PfxCertificate -FilePath $env:DotVast_PfxName -CertStoreLocation Cert:\CurrentUser\My -Password $password | |
| Remove-Variable -Name password | |
| # Create the app package by building and packaging the project | |
| - name: Create the app package | |
| run: | | |
| ./tools/Build-SideloadOnlyPackage.ps1 -Configuration ${{ matrix.configuration }} -Platform ${{ matrix.platform }} | |
| "DotVast_PackageName=$($OutputPackage.Name)" >> $env:GITHUB_ENV | |
| "DotVast_PackageDir=$($OutputPackage.Parent)" >> $env:GITHUB_ENV | |
| # Remove the pfx | |
| - name: Remove the pfx | |
| run: | | |
| Remove-Item -Path $env:DotVast_PfxName | |
| Remove-Item -Path Cert:\CurrentUser\My\$env:DotVast_PfxThumbprint | |
| # Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact | |
| - name: Upload MSIX package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.DotVast_PackageName }} | |
| path: ${{ env.DotVast_PackageDir }} |