Update dotnet-desktop.yml to support multiple build configurations an… #8
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: TTSBroswer | ||
| on: | ||
| push: | ||
| branches: [ "master" ] | ||
| pull_request: | ||
| branches: [ "master" ] | ||
| jobs: | ||
| build: | ||
| strategy: | ||
| matrix: | ||
| configuration: [Debug, Release] | ||
| runs-on: windows-latest | ||
| env: | ||
| Solution_Name: TTSBroswer.sln | ||
| Test_Project_Path: TTSBroswer.TTSBroswer/TTSBroswer.TTSBroswer.csproj | ||
| Wap_Project_Directory: TTSBroswer.TSBroswer | ||
| Wap_Project_Path: TTSBroswer.TTSBroswer/TTSBroswer.TTSBroswer.wapproj | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Install .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: 8.0.x | ||
| - name: Setup MSBuild | ||
| uses: microsoft/setup-msbuild@v2 | ||
| - name: Restore NuGet packages | ||
| run: dotnet restore $env:Solution_Name | ||
| - name: Build solution | ||
| run: msbuild $env:Solution_Name /p:Configuration=$env:Configuration | ||
| env: | ||
| Configuration: ${{ matrix.configuration }} | ||
| - name: Execute unit tests | ||
| run: dotnet test $env:Test_Project_Path --configuration $env:Configuration --no-build --verbosity normal | ||
| - name: Restore Wap project | ||
| run: msbuild $env:Wap_Project_Path /t:Restore /p:Configuration=$env:Configuration | ||
| env: | ||
| Configuration: ${{ matrix.configuration }} | ||
| - name: Decode the pfx | ||
| if: ${{ secrets.Base64_Encoded_Pfx != '' }} | ||
|
Check failure on line 54 in .github/workflows/dotnet-desktop.yml
|
||
| run: | | ||
| $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}") | ||
| $certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx | ||
| [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) | ||
| - name: Create the app package | ||
| run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:AppxBundlePlatforms=$env:Appx_Bundle_Platforms /p:PackageCertificateKeyFile=$env:Wap_Project_Directory\GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} | ||
| env: | ||
| Appx_Bundle: Always | ||
| Appx_Bundle_Platforms: x86|x64 | ||
| Appx_Package_Build_Mode: StoreUpload | ||
| Configuration: ${{ matrix.configuration }} | ||
| - name: Remove the pfx | ||
| if: ${{ secrets.Base64_Encoded_Pfx != '' }} | ||
| run: Remove-Item -Path "$env:Wap_Project_Directory\GitHubActionsWorkflow.pfx" -Force | ||
| - name: Upload build artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: MSIX Package | ||
| path: ${{ env.Wap_Project_Directory }}\AppPackages | ||