build.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. name: Build job
  2. on:
  3. push:
  4. branches: [ master ]
  5. paths-ignore:
  6. - '.github/*'
  7. - '.github/ISSUE_TEMPLATE/**'
  8. - '*.yml'
  9. - 'README.md'
  10. pull_request:
  11. branches: [ master ]
  12. paths-ignore:
  13. - '.github/*'
  14. - '.github/ISSUE_TEMPLATE/**'
  15. - '*.yml'
  16. - 'README.md'
  17. jobs:
  18. build:
  19. name: ${{ matrix.os }} (${{ matrix.configuration }})
  20. runs-on: ${{ matrix.os }}
  21. strategy:
  22. matrix:
  23. os: [ubuntu-latest, macOS-latest, windows-latest]
  24. configuration: [Debug, Release]
  25. include:
  26. - os: ubuntu-latest
  27. OS_NAME: Linux x64
  28. DOTNET_RUNTIME_IDENTIFIER: linux-x64
  29. RELEASE_ZIP_OS_NAME: linux_x64
  30. - os: macOS-latest
  31. OS_NAME: MacOS x64
  32. DOTNET_RUNTIME_IDENTIFIER: osx-x64
  33. RELEASE_ZIP_OS_NAME: osx_x64
  34. - os: windows-latest
  35. OS_NAME: Windows x64
  36. DOTNET_RUNTIME_IDENTIFIER: win-x64
  37. RELEASE_ZIP_OS_NAME: win_x64
  38. fail-fast: false
  39. env:
  40. POWERSHELL_TELEMETRY_OPTOUT: 1
  41. DOTNET_CLI_TELEMETRY_OPTOUT: 1
  42. steps:
  43. - uses: actions/checkout@v2
  44. - uses: actions/setup-dotnet@v1
  45. with:
  46. dotnet-version: 5.0.x
  47. - name: Ensure NuGet Source
  48. uses: fabriciomurta/ensure-nuget-source@v1
  49. - name: Get git short hash
  50. id: git_short_hash
  51. run: echo "::set-output name=result::$(git rev-parse --short "${{ github.sha }}")"
  52. - name: Clear
  53. run: dotnet clean && dotnet nuget locals all --clear
  54. - name: Build
  55. run: dotnet build -c "${{ matrix.configuration }}" /p:Version="1.0.0" /p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" /p:ExtraDefineConstants=DISABLE_UPDATER
  56. - name: Test
  57. run: dotnet test -c "${{ matrix.configuration }}"
  58. - name: Publish
  59. run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish /p:Version="1.0.0" /p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" /p:ExtraDefineConstants=DISABLE_UPDATER Ryujinx
  60. if: github.event_name == 'pull_request'
  61. - name: Upload artifacts
  62. uses: actions/upload-artifact@v2
  63. with:
  64. name: ryujinx-${{ matrix.configuration }}-1.0.0+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
  65. path: publish
  66. if: github.event_name == 'pull_request'