build.yml 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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: Get git short hash
  51. id: git_short_hash
  52. run: echo "result=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
  53. shell: bash
  54. - name: Build
  55. run: dotnet build -c "${{ matrix.configuration }}" -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER
  56. - name: Test
  57. run: dotnet test --no-build -c "${{ matrix.configuration }}"
  58. - name: Publish Ryujinx
  59. 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 true
  60. if: github.event_name == 'pull_request'
  61. - name: Publish Ryujinx.Headless.SDL2
  62. 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 true
  63. if: github.event_name == 'pull_request'
  64. - name: Publish Ryujinx.Ava
  65. run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish_ava -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER Ryujinx.Ava --self-contained true
  66. if: github.event_name == 'pull_request'
  67. - name: Upload Ryujinx artifact
  68. uses: actions/upload-artifact@v3
  69. with:
  70. name: ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
  71. path: publish
  72. if: github.event_name == 'pull_request'
  73. - name: Upload Ryujinx.Headless.SDL2 artifact
  74. uses: actions/upload-artifact@v3
  75. with:
  76. name: sdl2-ryujinx-headless-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
  77. path: publish_sdl2_headless
  78. if: github.event_name == 'pull_request'
  79. - name: Upload Ryujinx.Ava artifact
  80. uses: actions/upload-artifact@v3
  81. with:
  82. name: ava-ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
  83. path: publish_ava
  84. if: github.event_name == 'pull_request'