canary.yml 14 KB

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