canary.yml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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: "GreemDev"
  22. RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO: "Ryujinx"
  23. RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "Ryujinx-Canary"
  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: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/Canary-${{ steps.version_info.outputs.prev_build_version }}...Canary-${{ steps.version_info.outputs.build_version }}"
  52. omitBodyDuringUpdate: true
  53. owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
  54. repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
  55. token: ${{ secrets.RELEASE_TOKEN }}
  56. release:
  57. name: Release for ${{ matrix.platform.name }}
  58. runs-on: ${{ matrix.platform.os }}
  59. strategy:
  60. matrix:
  61. platform:
  62. - { name: win-x64, os: windows-latest, zip_os_name: win_x64 }
  63. - { name: linux-x64, os: ubuntu-latest, zip_os_name: linux_x64 }
  64. - { name: linux-arm64, os: ubuntu-latest, zip_os_name: linux_arm64 }
  65. steps:
  66. - uses: actions/checkout@v4
  67. - uses: actions/setup-dotnet@v4
  68. with:
  69. global-json-file: global.json
  70. - name: Overwrite csc problem matcher
  71. run: echo "::add-matcher::.github/csc.json"
  72. - name: Get version info
  73. id: version_info
  74. run: |
  75. echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
  76. echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
  77. echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
  78. shell: bash
  79. - name: Configure for release
  80. run: |
  81. sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  82. sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  83. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  84. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  85. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  86. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  87. sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
  88. shell: bash
  89. - name: Create output dir
  90. run: "mkdir release_output"
  91. - name: Publish
  92. run: |
  93. 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
  94. 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
  95. - name: Packing Windows builds
  96. if: matrix.platform.os == 'windows-latest'
  97. run: |
  98. pushd publish_ava
  99. rm publish/libarmeilleure-jitsupport.dylib
  100. 7z a ../release_output/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish
  101. popd
  102. pushd publish_sdl2_headless
  103. rm publish/libarmeilleure-jitsupport.dylib
  104. 7z a ../release_output/nogui-ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish
  105. popd
  106. shell: bash
  107. - name: Packing Linux builds
  108. if: matrix.platform.os == 'ubuntu-latest'
  109. run: |
  110. pushd publish_ava
  111. rm publish/libarmeilleure-jitsupport.dylib
  112. chmod +x publish/Ryujinx.sh publish/Ryujinx
  113. tar -czvf ../release_output/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish
  114. popd
  115. pushd publish_sdl2_headless
  116. rm publish/libarmeilleure-jitsupport.dylib
  117. chmod +x publish/Ryujinx.sh publish/Ryujinx.Headless.SDL2
  118. tar -czvf ../release_output/nogui-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 }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync"
  145. # BUILDDIR=publish_ava OUTDIR=publish_ava_appimage distribution/linux/appimage/build-appimage.sh
  146. # Add to release output
  147. # pushd publish_ava_appimage
  148. # mv Ryujinx.AppImage ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage
  149. # mv Ryujinx.AppImage.zsync ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync
  150. # popd
  151. # shell: bash
  152. - name: Pushing new release
  153. uses: ncipollo/release-action@v1
  154. with:
  155. name: ${{ steps.version_info.outputs.build_version }}
  156. artifacts: "release_output/*.tar.gz,release_output/*.zip"
  157. #artifacts: "release_output/*.tar.gz,release_output/*.zip/*AppImage*"
  158. tag: ${{ steps.version_info.outputs.build_version }}
  159. body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/Canary-${{ steps.version_info.outputs.prev_build_version }}...Canary-${{ steps.version_info.outputs.build_version }}"
  160. omitBodyDuringUpdate: true
  161. allowUpdates: true
  162. replacesArtifacts: true
  163. owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
  164. repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
  165. token: ${{ secrets.RELEASE_TOKEN }}
  166. macos_release:
  167. name: Release MacOS universal
  168. runs-on: ubuntu-latest
  169. steps:
  170. - uses: actions/checkout@v4
  171. - uses: actions/setup-dotnet@v4
  172. with:
  173. global-json-file: global.json
  174. - name: Setup LLVM 15
  175. run: |
  176. wget https://apt.llvm.org/llvm.sh
  177. chmod +x llvm.sh
  178. sudo ./llvm.sh 15
  179. - name: Install rcodesign
  180. run: |
  181. mkdir -p $HOME/.bin
  182. gh release download -R indygreg/apple-platform-rs -O apple-codesign.tar.gz -p 'apple-codesign-*-x86_64-unknown-linux-musl.tar.gz'
  183. tar -xzvf apple-codesign.tar.gz --wildcards '*/rcodesign' --strip-components=1
  184. rm apple-codesign.tar.gz
  185. mv rcodesign $HOME/.bin/
  186. echo "$HOME/.bin" >> $GITHUB_PATH
  187. env:
  188. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  189. - name: Get version info
  190. id: version_info
  191. run: |
  192. echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
  193. echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
  194. echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
  195. - name: Configure for release
  196. run: |
  197. sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  198. sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  199. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  200. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  201. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  202. sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
  203. sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
  204. shell: bash
  205. - name: Publish macOS Ryujinx
  206. run: |
  207. ./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
  208. - name: Publish macOS Ryujinx.Headless.SDL2
  209. run: |
  210. ./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
  211. - name: Pushing new release
  212. uses: ncipollo/release-action@v1
  213. with:
  214. name: "Canary ${{ steps.version_info.outputs.build_version }}"
  215. artifacts: "publish_ava/*.tar.gz, publish_headless/*.tar.gz"
  216. tag: ${{ steps.version_info.outputs.build_version }}
  217. body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/Canary-${{ steps.version_info.outputs.prev_build_version }}...Canary-${{ steps.version_info.outputs.build_version }}"
  218. omitBodyDuringUpdate: true
  219. allowUpdates: true
  220. replacesArtifacts: true
  221. owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
  222. repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
  223. token: ${{ secrets.RELEASE_TOKEN }}