canary.yml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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-20.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: context.repo.owner,
  42. repo: context.repo.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. shell: bash
  98. - name: Create output dir
  99. run: "mkdir release_output"
  100. - name: Publish
  101. run: |
  102. 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
  103. 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
  104. - name: Packing Windows builds
  105. if: matrix.platform.os == 'windows-latest'
  106. run: |
  107. pushd publish_ava
  108. rm publish/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. pushd publish_sdl2_headless
  112. rm publish/libarmeilleure-jitsupport.dylib
  113. 7z a ../release_output/nogui-ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish
  114. popd
  115. shell: bash
  116. - name: Packing Linux builds
  117. if: matrix.platform.os == 'ubuntu-latest'
  118. run: |
  119. pushd publish_ava
  120. rm publish/libarmeilleure-jitsupport.dylib
  121. chmod +x publish/Ryujinx.sh publish/Ryujinx
  122. tar -czvf ../release_output/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish
  123. popd
  124. pushd publish_sdl2_headless
  125. rm publish/libarmeilleure-jitsupport.dylib
  126. chmod +x publish/Ryujinx.sh publish/Ryujinx.Headless.SDL2
  127. tar -czvf ../release_output/nogui-ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish
  128. popd
  129. shell: bash
  130. #- name: Build AppImage (Linux)
  131. # if: matrix.platform.os == 'ubuntu-latest'
  132. # run: |
  133. # BUILD_VERSION="${{ steps.version_info.outputs.build_version }}"
  134. # PLATFORM_NAME="${{ matrix.platform.name }}"
  135. # sudo apt install -y zsync desktop-file-utils appstream
  136. # mkdir -p tools
  137. # export PATH="$PATH:$(readlink -f tools)"
  138. # Setup appimagetool
  139. # wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
  140. # chmod +x tools/appimagetool
  141. # chmod +x distribution/linux/appimage/build-appimage.sh
  142. # Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name)
  143. # if [ "$PLATFORM_NAME" = "linux-x64" ]; then
  144. # ARCH_NAME=x64
  145. # export ARCH=x86_64
  146. # elif [ "$PLATFORM_NAME" = "linux-arm64" ]; then
  147. # ARCH_NAME=arm64
  148. # export ARCH=aarch64
  149. # else
  150. # echo "Unexpected PLATFORM_NAME "$PLATFORM_NAME""
  151. # exit 1
  152. # fi
  153. # export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync"
  154. # BUILDDIR=publish_ava OUTDIR=publish_ava_appimage distribution/linux/appimage/build-appimage.sh
  155. # Add to release output
  156. # pushd publish_ava_appimage
  157. # mv Ryujinx.AppImage ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage
  158. # mv Ryujinx.AppImage.zsync ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync
  159. # popd
  160. # shell: bash
  161. - name: Pushing new release
  162. uses: ncipollo/release-action@v1
  163. with:
  164. name: ${{ steps.version_info.outputs.build_version }}
  165. artifacts: "release_output/*.tar.gz,release_output/*.zip"
  166. #artifacts: "release_output/*.tar.gz,release_output/*.zip/*AppImage*"
  167. tag: ${{ steps.version_info.outputs.build_version }}
  168. body: |
  169. # Canary builds:
  170. 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.
  171. | Platform | Artifact |
  172. |--|--|
  173. | 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) |
  174. | 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) |
  175. | 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) |
  176. | 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) |
  177. **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 }}
  178. omitBodyDuringUpdate: true
  179. allowUpdates: true
  180. replacesArtifacts: true
  181. owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
  182. repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
  183. token: ${{ secrets.RELEASE_TOKEN }}
  184. macos_release:
  185. name: Release MacOS universal
  186. runs-on: ubuntu-latest
  187. steps:
  188. - uses: actions/checkout@v4
  189. - uses: actions/setup-dotnet@v4
  190. with:
  191. global-json-file: global.json
  192. - name: Setup LLVM 15
  193. run: |
  194. wget https://apt.llvm.org/llvm.sh
  195. chmod +x llvm.sh
  196. sudo ./llvm.sh 15
  197. - name: Install rcodesign
  198. run: |
  199. mkdir -p $HOME/.bin
  200. gh release download -R indygreg/apple-platform-rs -O apple-codesign.tar.gz -p 'apple-codesign-*-x86_64-unknown-linux-musl.tar.gz'
  201. tar -xzvf apple-codesign.tar.gz --wildcards '*/rcodesign' --strip-components=1
  202. rm apple-codesign.tar.gz
  203. mv rcodesign $HOME/.bin/
  204. echo "$HOME/.bin" >> $GITHUB_PATH
  205. env:
  206. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  207. - name: Get version info
  208. id: version_info
  209. run: |
  210. echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
  211. echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
  212. echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
  213. - name: Configure for release
  214. run: |
  215. sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  216. sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  217. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  218. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  219. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  220. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  221. sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
  222. shell: bash
  223. - name: Publish macOS Ryujinx
  224. run: |
  225. ./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
  226. - name: Publish macOS Ryujinx.Headless.SDL2
  227. run: |
  228. ./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 1
  229. - name: Pushing new release
  230. uses: ncipollo/release-action@v1
  231. with:
  232. name: "Canary ${{ steps.version_info.outputs.build_version }}"
  233. artifacts: "publish_ava/*.tar.gz, publish_headless/*.tar.gz"
  234. tag: ${{ steps.version_info.outputs.build_version }}
  235. body: ""
  236. omitBodyDuringUpdate: true
  237. allowUpdates: true
  238. replacesArtifacts: true
  239. owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
  240. repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
  241. token: ${{ secrets.RELEASE_TOKEN }}