release.yml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. name: Release job
  2. on:
  3. workflow_dispatch:
  4. inputs: {}
  5. concurrency: release
  6. env:
  7. POWERSHELL_TELEMETRY_OPTOUT: 1
  8. DOTNET_CLI_TELEMETRY_OPTOUT: 1
  9. RYUJINX_BASE_VERSION: "1.2"
  10. RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "release"
  11. RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "Ryubing"
  12. RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "Ryujinx"
  13. RELEASE: 1
  14. jobs:
  15. tag:
  16. name: Create tag
  17. runs-on: ubuntu-24.04
  18. steps:
  19. - name: Get version info
  20. id: version_info
  21. run: |
  22. echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
  23. echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
  24. shell: bash
  25. - name: Create tag
  26. uses: actions/github-script@v7
  27. with:
  28. script: |
  29. github.rest.git.createRef({
  30. owner: "${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}",
  31. repo: "${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}",
  32. ref: 'refs/tags/${{ steps.version_info.outputs.build_version }}',
  33. sha: context.sha
  34. })
  35. - name: Create release
  36. uses: ncipollo/release-action@v1
  37. with:
  38. name: ${{ steps.version_info.outputs.build_version }}
  39. tag: ${{ steps.version_info.outputs.build_version }}
  40. body: |
  41. # Stable builds:
  42. | Platform | Artifact |
  43. |--|--|
  44. | Windows 64-bit | [Stable Windows Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-win_x64.zip) |
  45. | Linux 64-bit | [Stable Linux Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz) |
  46. | Linux ARM 64-bit | [Stable Linux ARM Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_arm64.tar.gz) |
  47. | macOS | [Stable macOS Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-macos_universal.app.tar.gz) |
  48. **Full Changelog**: https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}
  49. omitBodyDuringUpdate: true
  50. owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
  51. repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
  52. token: ${{ secrets.RELEASE_TOKEN }}
  53. release:
  54. name: Release for ${{ matrix.platform.name }}
  55. runs-on: ${{ matrix.platform.os }}
  56. strategy:
  57. matrix:
  58. platform:
  59. - { name: win-x64, os: windows-latest, zip_os_name: win_x64 }
  60. - { name: linux-x64, os: ubuntu-latest, zip_os_name: linux_x64 }
  61. - { name: linux-arm64, os: ubuntu-latest, zip_os_name: linux_arm64 }
  62. steps:
  63. - uses: actions/checkout@v4
  64. - uses: actions/setup-dotnet@v4
  65. with:
  66. global-json-file: global.json
  67. - name: Overwrite csc problem matcher
  68. run: echo "::add-matcher::.github/csc.json"
  69. - name: Get version info
  70. id: version_info
  71. run: |
  72. echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
  73. echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
  74. echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
  75. shell: bash
  76. - name: Configure for release
  77. run: |
  78. sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  79. sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  80. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  81. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  82. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  83. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  84. sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
  85. shell: bash
  86. - name: Create output dir
  87. run: "mkdir release_output"
  88. - name: Publish
  89. run: |
  90. dotnet publish -c Release -r "${{ matrix.platform.name }}" -o ./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
  91. - name: Packing Windows builds
  92. if: matrix.platform.os == 'windows-latest'
  93. run: |
  94. pushd publish
  95. rm libarmeilleure-jitsupport.dylib
  96. 7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip ../publish
  97. popd
  98. shell: bash
  99. - name: Packing Linux builds
  100. if: matrix.platform.os == 'ubuntu-latest'
  101. run: |
  102. pushd publish
  103. chmod +x Ryujinx.sh Ryujinx
  104. tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz ../publish
  105. popd
  106. shell: bash
  107. - name: Build AppImage (Linux)
  108. if: matrix.platform.os == 'ubuntu-latest'
  109. run: |
  110. BUILD_VERSION="${{ steps.version_info.outputs.build_version }}"
  111. PLATFORM_NAME="${{ matrix.platform.name }}"
  112. sudo apt install -y zsync desktop-file-utils appstream
  113. mkdir -p tools
  114. export PATH="$PATH:$(readlink -f tools)"
  115. # Setup appimagetool
  116. wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
  117. chmod +x tools/appimagetool
  118. chmod +x distribution/linux/appimage/build-appimage.sh
  119. # Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name)
  120. if [ "$PLATFORM_NAME" = "linux-x64" ]; then
  121. ARCH_NAME=x64
  122. export ARCH=x86_64
  123. elif [ "$PLATFORM_NAME" = "linux-arm64" ]; then
  124. ARCH_NAME=arm64
  125. export ARCH=aarch64
  126. else
  127. echo "Unexpected PLATFORM_NAME "$PLATFORM_NAME""
  128. exit 1
  129. fi
  130. export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync"
  131. BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh
  132. pushd publish_appimage
  133. mv Ryujinx.AppImage ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage
  134. mv Ryujinx.AppImage.zsync ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync
  135. popd
  136. shell: bash
  137. - name: Pushing new release
  138. uses: ncipollo/release-action@v1
  139. with:
  140. name: ${{ steps.version_info.outputs.build_version }}
  141. artifacts: "release_output/*.tar.gz,release_output/*.zip,release_output/*AppImage*"
  142. tag: ${{ steps.version_info.outputs.build_version }}
  143. body: |
  144. # Stable builds:
  145. | Platform | Artifact |
  146. |--|--|
  147. | Windows 64-bit | [Stable Windows Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-win_x64.zip) |
  148. | Linux 64-bit | [Stable Linux Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz) |
  149. | Linux ARM 64-bit | [Stable Linux ARM Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_arm64.tar.gz) |
  150. | macOS | [Stable macOS Artifact](https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/releases/download/${{ steps.version_info.outputs.build_version }}/ryujinx-${{ steps.version_info.outputs.build_version }}-macos_universal.app.tar.gz) |
  151. **Full Changelog**: https://github.com/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}
  152. omitBodyDuringUpdate: true
  153. allowUpdates: true
  154. replacesArtifacts: true
  155. owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
  156. repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
  157. token: ${{ secrets.RELEASE_TOKEN }}
  158. macos_release:
  159. name: Release MacOS universal
  160. runs-on: ubuntu-24.04
  161. steps:
  162. - uses: actions/checkout@v4
  163. - uses: actions/setup-dotnet@v4
  164. with:
  165. global-json-file: global.json
  166. - name: Setup LLVM 17
  167. run: |
  168. wget https://apt.llvm.org/llvm.sh
  169. chmod +x llvm.sh
  170. sudo ./llvm.sh 17
  171. - name: Install rcodesign
  172. run: |
  173. mkdir -p $HOME/.bin
  174. gh release download -R indygreg/apple-platform-rs -O apple-codesign.tar.gz -p 'apple-codesign-*-x86_64-unknown-linux-musl.tar.gz'
  175. tar -xzvf apple-codesign.tar.gz --wildcards '*/rcodesign' --strip-components=1
  176. rm apple-codesign.tar.gz
  177. mv rcodesign $HOME/.bin/
  178. echo "$HOME/.bin" >> $GITHUB_PATH
  179. env:
  180. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  181. - name: Get version info
  182. id: version_info
  183. run: |
  184. echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
  185. echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
  186. echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
  187. - name: Configure for release
  188. run: |
  189. sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  190. sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  191. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  192. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  193. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  194. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  195. sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
  196. shell: bash
  197. - name: Publish macOS Ryujinx
  198. run: |
  199. ./distribution/macos/create_macos_build_ava.sh . publish_tmp_ava publish ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release 0
  200. - name: Pushing new release
  201. uses: ncipollo/release-action@v1
  202. with:
  203. name: ${{ steps.version_info.outputs.build_version }}
  204. artifacts: "publish/*.tar.gz"
  205. tag: ${{ steps.version_info.outputs.build_version }}
  206. body: ""
  207. omitBodyDuringUpdate: true
  208. allowUpdates: true
  209. replacesArtifacts: true
  210. owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
  211. repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
  212. token: ${{ secrets.RELEASE_TOKEN }}