dotnet-desktop.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. name: .NET Core Desktop
  2. on:
  3. push:
  4. branches: [ "main" ]
  5. pull_request:
  6. branches: [ "main" ]
  7. jobs:
  8. build:
  9. strategy:
  10. matrix:
  11. configuration: [Debug, Release]
  12. runs-on: windows-latest
  13. env:
  14. Solution_Name: Plain Craft Launcher 2.sln
  15. Wap_Project_Directory: Plain Craft Launcher 2
  16. Wap_Project_Path: Plain Craft Launcher 2\Plain Craft Launcher 2.vbproj
  17. steps:
  18. - name: Checkout
  19. uses: actions/checkout@v4
  20. with:
  21. fetch-depth: 0
  22. # Install the .NET Core workload
  23. - name: Install .NET Core
  24. uses: actions/setup-dotnet@v4
  25. with:
  26. dotnet-version: 5
  27. # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
  28. - name: Setup MSBuild.exe
  29. uses: microsoft/setup-msbuild@v2
  30. # Execute all unit tests in the solution
  31. - name: Execute unit tests
  32. run: dotnet test
  33. # Restore the application to populate the obj folder with RuntimeIdentifiers
  34. - name: Restore the application
  35. run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
  36. env:
  37. Configuration: ${{ matrix.configuration }}
  38. # Create the app package by building and packaging the Windows Application Packaging project
  39. - name: Create the app package
  40. run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle
  41. env:
  42. Appx_Bundle: Always
  43. Appx_Bundle_Platforms: x86|x64
  44. Appx_Package_Build_Mode: StoreUpload
  45. Configuration: ${{ matrix.configuration }}
  46. # Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact
  47. - name: Upload build artifacts
  48. uses: actions/upload-artifact@v3
  49. with:
  50. name: ${{ matrix.configuration }}
  51. path: ${{ env.Wap_Project_Directory }}\obj\${{ matrix.configuration }}\Plain Craft Launcher 2.exe