dotnet-desktop.yml 2.1 KB

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