name: Release job on: workflow_dispatch: inputs: {} push: branches: [ master ] paths-ignore: - '.github/**' - '*.yml' - '*.json' - '*.config' - '*.md' concurrency: release env: POWERSHELL_TELEMETRY_OPTOUT: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1 RYUJINX_BASE_VERSION: "1.1" RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "master" RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "${{ github.repository_owner }}" RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "${{ github.event.repository.name }}" jobs: tag: name: Create tag runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 with: token: ${{ secrets.GITHUB_TOKEN }} fetch-depth: 0 - name: Get version info id: version_info run: | echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT shell: bash - name: Get version info id: version_info run: | echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT shell: bash - name: Create tag run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git tag ${{ steps.version_info.outputs.build_version }} git push origin ${{ steps.version_info.outputs.build_version }} shell: bash env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create release run: | curl -X POST \ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Content-Type: application/json" \ -d '{ "tag_name": "${{ steps.version_info.outputs.build_version }}", "name": "${{ steps.version_info.outputs.build_version }}", "body": "For more information about this release please check out the official [Changelog](https://github.com/Ryujinx/Ryujinx/wiki/Changelog).", "draft": false, "prerelease": false }' \ "${{ github.api_url }}/repos/${{ github.repository }}/releases" shell: bash release: name: Release for ${{ matrix.platform.name }} runs-on: ${{ matrix.platform.os }} timeout-minutes: ${{ fromJSON(vars.JOB_TIMEOUT) }} strategy: matrix: platform: - { name: win-x64, os: windows-latest, zip_os_name: win_x64 } - { name: linux-x64, os: ubuntu-latest, zip_os_name: linux_x64 } - { name: linux-arm64, os: ubuntu-latest, zip_os_name: linux_arm64 } steps: - uses: actions/checkout@v4 - name: Overwrite csc problem matcher run: echo "::add-matcher::.github/csc.json" - name: Get version info id: version_info run: | echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT shell: bash - name: Configure for release run: | sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs shell: bash - name: Create output dir run: "mkdir release_output" - name: Publish run: | 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 true 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 true - name: Packing Windows builds if: matrix.platform.os == 'windows-latest' run: | pushd publish_ava cp publish/Ryujinx.exe publish/Ryujinx.Ava.exe 7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish 7z a ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish popd pushd publish_sdl2_headless 7z a ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish popd shell: bash - name: Packing Linux builds if: matrix.platform.os == 'ubuntu-latest' run: | pushd publish_ava cp publish/Ryujinx publish/Ryujinx.Ava chmod +x publish/Ryujinx.sh publish/Ryujinx.Ava publish/Ryujinx tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish tar -czvf ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish popd pushd publish_sdl2_headless chmod +x publish/Ryujinx.sh publish/Ryujinx.Headless.SDL2 tar -czvf ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish popd shell: bash - name: Create/update release and upload artifacts run: | # Get release ID if it exists, or create new release RELEASE_RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ "${{ github.api_url }}/repos/${{ github.repository }}/releases/tags/${{ steps.version_info.outputs.build_version }}") RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2) if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "" ]; then echo "Release not found, creating new release" RELEASE_RESPONSE=$(curl -X POST \ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Content-Type: application/json" \ -d '{ "tag_name": "${{ steps.version_info.outputs.build_version }}", "name": "${{ steps.version_info.outputs.build_version }}", "body": "For more information about this release please check out the official [Changelog](https://github.com/Ryujinx/Ryujinx/wiki/Changelog).", "draft": false, "prerelease": false }' \ "${{ github.api_url }}/repos/${{ github.repository }}/releases") RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2) else echo "Release exists, using ID: $RELEASE_ID" fi # Upload artifacts for file in release_output/*.tar.gz release_output/*.zip; do if [ -f "$file" ]; then filename=$(basename "$file") echo "Uploading $filename..." curl -X POST \ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Content-Type: application/octet-stream" \ --data-binary "@$file" \ "${{ github.api_url }}/repos/${{ github.repository }}/releases/$RELEASE_ID/assets?name=$filename" fi done shell: bash # macOS release job commented out - requires Apple developer account # macos_release: # name: Release MacOS universal # runs-on: ubuntu-latest # timeout-minutes: ${{ fromJSON(vars.JOB_TIMEOUT) }} # steps: # - uses: actions/checkout@v4 # - name: Install rcodesign # run: | # mkdir -p $HOME/.bin # gh release download -R indygreg/apple-platform-rs -O apple-codesign.tar.gz -p 'apple-codesign-*-x86_64-unknown-linux-musl.tar.gz' # tar -xzvf apple-codesign.tar.gz --wildcards '*/rcodesign' --strip-components=1 # rm apple-codesign.tar.gz # mv rcodesign $HOME/.bin/ # echo "$HOME/.bin" >> $GITHUB_PATH # env: # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # - name: Get version info # id: version_info # run: | # echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT # echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT # - name: Configure for release # run: | # sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs # sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs # sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs # sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs # sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs # sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs # shell: bash # - name: Publish macOS Ryujinx # run: | # ./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 # - name: Publish macOS Ryujinx.Headless.SDL2 # run: | # ./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 # - name: Create/update release and upload macOS artifacts # run: | # # Get release ID if it exists, or create new release # RELEASE_RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ # "${{ github.api_url }}/repos/${{ github.repository }}/releases/tags/${{ steps.version_info.outputs.build_version }}") # RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2) # if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "" ]; then # echo "Release not found, creating new release" # RELEASE_RESPONSE=$(curl -X POST \ # -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ # -H "Content-Type: application/json" \ # -d '{ # "tag_name": "${{ steps.version_info.outputs.build_version }}", # "name": "${{ steps.version_info.outputs.build_version }}", # "body": "For more information about this release please check out the official [Changelog](https://github.com/Ryujinx/Ryujinx/wiki/Changelog).", # "draft": false, # "prerelease": false # }' \ # "${{ github.api_url }}/repos/${{ github.repository }}/releases") # RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2) # else # echo "Release exists, using ID: $RELEASE_ID" # fi # # Upload macOS artifacts # for file in publish_ava/*.tar.gz publish_headless/*.tar.gz; do # if [ -f "$file" ]; then # filename=$(basename "$file") # echo "Uploading $filename..." # curl -X POST \ # -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ # -H "Content-Type: application/octet-stream" \ # --data-binary "@$file" \ # "${{ github.api_url }}/repos/${{ github.repository }}/releases/$RELEASE_ID/assets?name=$filename" # fi # done # shell: bash flatpak_release: uses: ./.github/workflows/flatpak.yml needs: release with: ryujinx_version: "1.1.${{ github.run_number }}" secrets: inherit