build.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. name: Build job
  2. on:
  3. workflow_dispatch:
  4. inputs: {}
  5. #push:
  6. # branches: [ master ]
  7. # paths-ignore:
  8. # - '.github/*'
  9. # - '.github/ISSUE_TEMPLATE/**'
  10. # - '*.yml'
  11. # - 'README.md'
  12. pull_request:
  13. branches: [ master ]
  14. paths-ignore:
  15. - '.github/*'
  16. - '.github/ISSUE_TEMPLATE/**'
  17. - '*.yml'
  18. - 'README.md'
  19. jobs:
  20. build:
  21. name: ${{ matrix.os }} (${{ matrix.configuration }})
  22. runs-on: ${{ matrix.os }}
  23. strategy:
  24. matrix:
  25. os: [ubuntu-latest, macOS-latest, windows-latest]
  26. configuration: [Debug, Release]
  27. include:
  28. - os: ubuntu-latest
  29. OS_NAME: Linux x64
  30. DOTNET_RUNTIME_IDENTIFIER: linux-x64
  31. RELEASE_ZIP_OS_NAME: linux_x64
  32. - os: macOS-latest
  33. OS_NAME: MacOS x64
  34. DOTNET_RUNTIME_IDENTIFIER: osx-x64
  35. RELEASE_ZIP_OS_NAME: osx_x64
  36. - os: windows-latest
  37. OS_NAME: Windows x64
  38. DOTNET_RUNTIME_IDENTIFIER: win10-x64
  39. RELEASE_ZIP_OS_NAME: win_x64
  40. fail-fast: false
  41. env:
  42. POWERSHELL_TELEMETRY_OPTOUT: 1
  43. DOTNET_CLI_TELEMETRY_OPTOUT: 1
  44. RYUJINX_BASE_VERSION: "1.1.0"
  45. steps:
  46. - uses: actions/checkout@v3
  47. - uses: actions/setup-dotnet@v3
  48. with:
  49. dotnet-version: 7.0.x
  50. - name: Ensure NuGet Source
  51. uses: fabriciomurta/ensure-nuget-source@v1
  52. - name: Get git short hash
  53. id: git_short_hash
  54. run: echo "result=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
  55. shell: bash
  56. - name: Clear
  57. run: dotnet clean && dotnet nuget locals all --clear
  58. - name: Build
  59. run: dotnet build -c "${{ matrix.configuration }}" /p:Version="${{ env.RYUJINX_BASE_VERSION }}" /p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" /p:ExtraDefineConstants=DISABLE_UPDATER
  60. - name: Test
  61. run: dotnet test --no-build -c "${{ matrix.configuration }}"
  62. - name: Publish Ryujinx
  63. run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish /p:Version="${{ env.RYUJINX_BASE_VERSION }}" /p:DebugType=embedded /p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" /p:ExtraDefineConstants=DISABLE_UPDATER Ryujinx --self-contained
  64. if: github.event_name == 'pull_request'
  65. - name: Publish Ryujinx.Headless.SDL2
  66. run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish_sdl2_headless /p:Version="${{ env.RYUJINX_BASE_VERSION }}" /p:DebugType=embedded /p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" /p:ExtraDefineConstants=DISABLE_UPDATER Ryujinx.Headless.SDL2 --self-contained
  67. if: github.event_name == 'pull_request'
  68. - name: Publish Ryujinx.Ava
  69. run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish_ava /p:Version="1.0.0" /p:DebugType=embedded /p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" /p:ExtraDefineConstants=DISABLE_UPDATER Ryujinx.Ava
  70. if: github.event_name == 'pull_request'
  71. - name: Upload Ryujinx artifact
  72. uses: actions/upload-artifact@v3
  73. with:
  74. name: ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
  75. path: publish
  76. if: github.event_name == 'pull_request'
  77. - name: Upload Ryujinx.Headless.SDL2 artifact
  78. uses: actions/upload-artifact@v3
  79. with:
  80. name: sdl2-ryujinx-headless-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
  81. path: publish_sdl2_headless
  82. if: github.event_name == 'pull_request'
  83. - name: Upload Ryujinx.Ava artifact
  84. uses: actions/upload-artifact@v3
  85. with:
  86. name: ava-ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
  87. path: publish_ava
  88. if: github.event_name == 'pull_request'