release.yml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. name: Release job
  2. on:
  3. workflow_dispatch:
  4. inputs: {}
  5. push:
  6. branches: [ master ]
  7. paths-ignore:
  8. - '.github/**'
  9. - '*.yml'
  10. - '*.json'
  11. - '*.config'
  12. - 'README.md'
  13. concurrency: release
  14. env:
  15. POWERSHELL_TELEMETRY_OPTOUT: 1
  16. DOTNET_CLI_TELEMETRY_OPTOUT: 1
  17. RYUJINX_BASE_VERSION: "1.1"
  18. RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "master"
  19. RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "Ryujinx"
  20. RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "release-channel-master"
  21. jobs:
  22. tag:
  23. name: Create tag
  24. runs-on: ubuntu-latest
  25. steps:
  26. - name: Get version info
  27. id: version_info
  28. run: |
  29. echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
  30. shell: bash
  31. - name: Create tag
  32. uses: actions/github-script@v6
  33. with:
  34. script: |
  35. github.rest.git.createRef({
  36. owner: context.repo.owner,
  37. repo: context.repo.repo,
  38. ref: 'refs/tags/${{ steps.version_info.outputs.build_version }}',
  39. sha: context.sha
  40. })
  41. release:
  42. name: Release ${{ matrix.OS_NAME }}
  43. runs-on: ${{ matrix.os }}
  44. timeout-minutes: ${{ fromJSON(vars.JOB_TIMEOUT) }}
  45. strategy:
  46. matrix:
  47. os: [ ubuntu-latest, windows-latest ]
  48. include:
  49. - os: ubuntu-latest
  50. OS_NAME: Linux x64
  51. DOTNET_RUNTIME_IDENTIFIER: linux-x64
  52. RELEASE_ZIP_OS_NAME: linux_x64
  53. - os: windows-latest
  54. OS_NAME: Windows x64
  55. DOTNET_RUNTIME_IDENTIFIER: win10-x64
  56. RELEASE_ZIP_OS_NAME: win_x64
  57. steps:
  58. - uses: actions/checkout@v3
  59. - uses: actions/setup-dotnet@v3
  60. with:
  61. global-json-file: global.json
  62. - name: Get version info
  63. id: version_info
  64. run: |
  65. echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
  66. echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
  67. shell: bash
  68. - name: Configure for release
  69. run: |
  70. sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  71. sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  72. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  73. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  74. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  75. shell: bash
  76. - name: Create output dir
  77. run: "mkdir release_output"
  78. - name: Publish
  79. run: |
  80. dotnet publish -c Release -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish_gtk/publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx --self-contained true
  81. dotnet publish -c Release -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish_sdl2_headless/publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx.Headless.SDL2 --self-contained true
  82. dotnet publish -c Release -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish_ava/publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx.Ava --self-contained true
  83. - name: Packing Windows builds
  84. if: matrix.os == 'windows-latest'
  85. run: |
  86. pushd publish_gtk
  87. 7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-win_x64.zip publish
  88. popd
  89. pushd publish_sdl2_headless
  90. 7z a ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-win_x64.zip publish
  91. popd
  92. pushd publish_ava
  93. 7z a ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-win_x64.zip publish
  94. popd
  95. shell: bash
  96. - name: Packing Linux builds
  97. if: matrix.os == 'ubuntu-latest'
  98. run: |
  99. pushd publish_gtk
  100. chmod +x publish/Ryujinx.sh publish/Ryujinx
  101. tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz publish
  102. popd
  103. pushd publish_sdl2_headless
  104. chmod +x publish/Ryujinx.sh publish/Ryujinx.Headless.SDL2
  105. tar -czvf ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz publish
  106. popd
  107. pushd publish_ava
  108. chmod +x publish/Ryujinx.sh publish/Ryujinx.Ava
  109. tar -czvf ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz publish
  110. popd
  111. shell: bash
  112. - name: Pushing new release
  113. uses: ncipollo/release-action@v1
  114. with:
  115. name: ${{ steps.version_info.outputs.build_version }}
  116. artifacts: "release_output/*.tar.gz,release_output/*.zip"
  117. tag: ${{ steps.version_info.outputs.build_version }}
  118. body: "For more information about this release please check out the official [Changelog](https://github.com/Ryujinx/Ryujinx/wiki/Changelog)."
  119. omitBodyDuringUpdate: true
  120. allowUpdates: true
  121. replacesArtifacts: true
  122. owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
  123. repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
  124. token: ${{ secrets.RELEASE_TOKEN }}
  125. macos_release:
  126. name: Release MacOS universal
  127. runs-on: ubuntu-latest
  128. timeout-minutes: ${{ fromJSON(vars.JOB_TIMEOUT) }}
  129. steps:
  130. - uses: actions/checkout@v3
  131. - uses: actions/setup-dotnet@v3
  132. with:
  133. global-json-file: global.json
  134. - name: Setup LLVM 14
  135. run: |
  136. wget https://apt.llvm.org/llvm.sh
  137. chmod +x llvm.sh
  138. sudo ./llvm.sh 14
  139. - name: Install rcodesign
  140. run: |
  141. mkdir -p $HOME/.bin
  142. gh release download -R indygreg/apple-platform-rs -O apple-codesign.tar.gz -p 'apple-codesign-*-x86_64-unknown-linux-musl.tar.gz'
  143. tar -xzvf apple-codesign.tar.gz --wildcards '*/rcodesign' --strip-components=1
  144. rm apple-codesign.tar.gz
  145. mv rcodesign $HOME/.bin/
  146. echo "$HOME/.bin" >> $GITHUB_PATH
  147. env:
  148. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  149. - name: Get version info
  150. id: version_info
  151. run: |
  152. echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
  153. echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
  154. - name: Configure for release
  155. run: |
  156. sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  157. sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  158. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  159. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  160. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  161. shell: bash
  162. - name: Publish macOS
  163. run: |
  164. ./distribution/macos/create_macos_build.sh . publish_tmp publish_ava ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release
  165. - name: Pushing new release
  166. uses: ncipollo/release-action@v1
  167. with:
  168. name: ${{ steps.version_info.outputs.build_version }}
  169. artifacts: "publish_ava/*.tar.gz"
  170. tag: ${{ steps.version_info.outputs.build_version }}
  171. body: "For more information about this release please check out the official [Changelog](https://github.com/Ryujinx/Ryujinx/wiki/Changelog)."
  172. omitBodyDuringUpdate: true
  173. allowUpdates: true
  174. replacesArtifacts: true
  175. owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
  176. repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
  177. token: ${{ secrets.RELEASE_TOKEN }}
  178. flatpak_release:
  179. uses: ./.github/workflows/flatpak.yml
  180. needs: release
  181. with:
  182. ryujinx_version: "1.1.${{ github.run_number }}"
  183. secrets: inherit