build.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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: win-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. steps:
  45. - uses: actions/checkout@v2
  46. - uses: actions/setup-dotnet@v1
  47. with:
  48. dotnet-version: 5.0.x
  49. - name: Ensure NuGet Source
  50. uses: fabriciomurta/ensure-nuget-source@v1
  51. - name: Get git short hash
  52. id: git_short_hash
  53. run: echo "::set-output name=result::$(git rev-parse --short "${{ github.sha }}")"
  54. - name: Clear
  55. run: dotnet clean && dotnet nuget locals all --clear
  56. - name: Build
  57. run: dotnet build -c "${{ matrix.configuration }}" /p:Version="1.0.0" /p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" /p:ExtraDefineConstants=DISABLE_UPDATER
  58. - name: Test
  59. run: dotnet test -c "${{ matrix.configuration }}"
  60. - name: Publish
  61. 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
  62. if: github.event_name == 'pull_request'
  63. - name: Upload artifacts
  64. uses: actions/upload-artifact@v2
  65. with:
  66. name: ryujinx-${{ matrix.configuration }}-1.0.0+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
  67. path: publish
  68. if: github.event_name == 'pull_request'