desktop.yml #1
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: .NET Desktop | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
configuration: [Debug, Release] | |
runs-on: windows-latest | |
env: | |
Solution_Name: FaceDetectionApp.sln | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install .NET Framework | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '4.8.x' | |
- name: Setup MSBuild | |
uses: microsoft/[email protected] | |
- name: Execute unit tests | |
run: dotnet test ${{ env.Test_Project_Path }} | |
- name: Restore the application | |
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration | |
env: | |
Configuration: ${{ matrix.configuration }} | |
- name: Decode the pfx | |
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=StoreUpload /p:AppxBundle=Always /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} | |
env: | |
Configuration: ${{ matrix.configuration }} | |
- name: Remove the pfx | |
run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: MSIX Package | |
path: ${{ env.Wap_Project_Directory }}\AppPackages |