canary.yml 14 KB

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