release.yml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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. - '*.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-20.04
  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 for ${{ matrix.platform.name }}
  43. runs-on: ${{ matrix.platform.os }}
  44. timeout-minutes: ${{ fromJSON(vars.JOB_TIMEOUT) }}
  45. strategy:
  46. matrix:
  47. platform:
  48. - { name: win-x64, os: windows-latest, zip_os_name: win_x64 }
  49. - { name: linux-x64, os: ubuntu-latest, zip_os_name: linux_x64 }
  50. - { name: linux-arm64, os: ubuntu-latest, zip_os_name: linux_arm64 }
  51. steps:
  52. - uses: actions/checkout@v4
  53. - uses: actions/setup-dotnet@v4
  54. with:
  55. global-json-file: global.json
  56. - name: Overwrite csc problem matcher
  57. run: echo "::add-matcher::.github/csc.json"
  58. - name: Get version info
  59. id: version_info
  60. run: |
  61. echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
  62. echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
  63. shell: bash
  64. - name: Configure for release
  65. run: |
  66. sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  67. sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  68. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  69. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  70. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  71. sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
  72. shell: bash
  73. - name: Create output dir
  74. run: "mkdir release_output"
  75. - name: Publish
  76. run: |
  77. dotnet publish -c Release -r "${{ matrix.platform.name }}" -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 --self-contained true
  78. dotnet publish -c Release -r "${{ matrix.platform.name }}" -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
  79. - name: Packing Windows builds
  80. if: matrix.platform.os == 'windows-latest'
  81. run: |
  82. pushd publish_ava
  83. 7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish
  84. popd
  85. pushd publish_sdl2_headless
  86. 7z a ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish
  87. popd
  88. pushd publish_ava
  89. mv publish/Ryujinx.exe publish/Ryujinx.Ava.exe
  90. 7z a ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish
  91. popd
  92. shell: bash
  93. - name: Packing Linux builds
  94. if: matrix.platform.os == 'ubuntu-latest'
  95. run: |
  96. pushd publish_ava
  97. chmod +x publish/Ryujinx.sh publish/Ryujinx
  98. tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish
  99. popd
  100. pushd publish_sdl2_headless
  101. chmod +x publish/Ryujinx.sh publish/Ryujinx.Headless.SDL2
  102. tar -czvf ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish
  103. popd
  104. pushd publish_ava
  105. mv publish/Ryujinx publish/Ryujinx.Ava
  106. chmod +x publish/Ryujinx.sh publish/Ryujinx.Ava
  107. tar -czvf ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish
  108. popd
  109. shell: bash
  110. - name: Pushing new release
  111. uses: ncipollo/release-action@v1
  112. with:
  113. name: ${{ steps.version_info.outputs.build_version }}
  114. artifacts: "release_output/*.tar.gz,release_output/*.zip"
  115. tag: ${{ steps.version_info.outputs.build_version }}
  116. body: "For more information about this release please check out the official [Changelog](https://github.com/Ryujinx/Ryujinx/wiki/Changelog)."
  117. omitBodyDuringUpdate: true
  118. allowUpdates: true
  119. replacesArtifacts: true
  120. owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
  121. repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
  122. token: ${{ secrets.RELEASE_TOKEN }}
  123. macos_release:
  124. name: Release MacOS universal
  125. runs-on: ubuntu-latest
  126. timeout-minutes: ${{ fromJSON(vars.JOB_TIMEOUT) }}
  127. steps:
  128. - uses: actions/checkout@v4
  129. - uses: actions/setup-dotnet@v4
  130. with:
  131. global-json-file: global.json
  132. - name: Setup LLVM 15
  133. run: |
  134. wget https://apt.llvm.org/llvm.sh
  135. chmod +x llvm.sh
  136. sudo ./llvm.sh 15
  137. - name: Install rcodesign
  138. run: |
  139. mkdir -p $HOME/.bin
  140. gh release download -R indygreg/apple-platform-rs -O apple-codesign.tar.gz -p 'apple-codesign-*-x86_64-unknown-linux-musl.tar.gz'
  141. tar -xzvf apple-codesign.tar.gz --wildcards '*/rcodesign' --strip-components=1
  142. rm apple-codesign.tar.gz
  143. mv rcodesign $HOME/.bin/
  144. echo "$HOME/.bin" >> $GITHUB_PATH
  145. env:
  146. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  147. - name: Get version info
  148. id: version_info
  149. run: |
  150. echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
  151. echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
  152. - name: Configure for release
  153. run: |
  154. sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  155. sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  156. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  157. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  158. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  159. sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
  160. shell: bash
  161. - name: Publish macOS Ryujinx
  162. run: |
  163. ./distribution/macos/create_macos_build_ava.sh . publish_tmp_ava publish_ava ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release
  164. - name: Publish macOS Ryujinx.Headless.SDL2
  165. run: |
  166. ./distribution/macos/create_macos_build_headless.sh . publish_tmp_headless publish_headless ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release
  167. - name: Pushing new release
  168. uses: ncipollo/release-action@v1
  169. with:
  170. name: ${{ steps.version_info.outputs.build_version }}
  171. artifacts: "publish_ava/*.tar.gz, publish_headless/*.tar.gz"
  172. tag: ${{ steps.version_info.outputs.build_version }}
  173. body: "For more information about this release please check out the official [Changelog](https://github.com/Ryujinx/Ryujinx/wiki/Changelog)."
  174. omitBodyDuringUpdate: true
  175. allowUpdates: true
  176. replacesArtifacts: true
  177. owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
  178. repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
  179. token: ${{ secrets.RELEASE_TOKEN }}
  180. flatpak_release:
  181. uses: ./.github/workflows/flatpak.yml
  182. needs: release
  183. with:
  184. ryujinx_version: "1.1.${{ github.run_number }}"
  185. secrets: inherit