build.yml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.tar.gz
  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: Get git short hash
  48. id: git_short_hash
  49. run: echo "::set-output name=result::$(git rev-parse --short HEAD)"
  50. - name: Clear
  51. run: dotnet clean && dotnet nuget locals all --clear
  52. - name: Build
  53. run: dotnet build -c "${{ matrix.configuration }}" /p:Version="1.0.0" /p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" /p:ExtraDefineConstants=DISABLE_UPDATER
  54. - name: Test
  55. run: dotnet test -c "${{ matrix.configuration }}"
  56. - name: Publish
  57. 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
  58. if: github.event_name == 'pull_request'
  59. - name: Packing artifacts (Normal)
  60. run: |
  61. mkdir output
  62. 7z a "./output/ryujinx-${{ matrix.configuration }}-1.0.0+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}.zip" ./publish
  63. if: github.event_name == 'pull_request' && matrix.os != 'ubuntu-latest'
  64. - name: Packing artifacts (Linux only)
  65. run: |
  66. mkdir output
  67. 7z a "ryujinx-${{ matrix.configuration }}-1.0.0+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}.tar" ./publish
  68. 7z a "./output/ryujinx-${{ matrix.configuration }}-1.0.0+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}.tar.gz" "ryujinx-${{ matrix.configuration }}-1.0.0+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}.tar"
  69. if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
  70. - name: Upload artifacts
  71. uses: actions/upload-artifact@v2
  72. with:
  73. name: Output ${{ matrix.OS_NAME }} (${{ matrix.configuration }})
  74. path: output
  75. if: github.event_name == 'pull_request'