diff --git a/.github/actions/ryujinx-release/action.yml b/.github/actions/ryujinx-release/action.yml new file mode 100644 index 000000000..9e7803b29 --- /dev/null +++ b/.github/actions/ryujinx-release/action.yml @@ -0,0 +1,118 @@ +name: Create Ryujinx release builds +description: Prepares everything for a new release + +inputs: + base_version: + description: Base version + default: "1.1" + required: true + rid: + description: .NET runtime identifier or 'osx-universal' + required: true + channel: + description: Release channel name + default: "master" + required: true + owner: + description: Release channel owner + default: "Ryujinx" + required: true + repo: + description: Release channel repo + default: "release-channel-master" + required: true + +outputs: + build_version: + description: Build version + value: ${{ steps.version_info.outputs.build_version }} + +runs: + using: composite + steps: + - uses: actions/setup-dotnet@v3 + with: + global-json-file: global.json + + - name: Overwrite csc problem matcher + run: echo "::add-matcher::.github/csc.json" + shell: bash + + - name: Extract RID components + id: rid + run: | + echo "os=$(echo ${{ inputs.rid }} | awk -F'-' '{ print $1 }')" >> $GITHUB_OUTPUT + echo "arch=$(echo ${{ inputs.rid }} | awk -F'-' '{ print $NF }')" >> $GITHUB_OUTPUT + shell: bash + + - name: Get version info + id: version_info + run: | + echo "build_version=${{ inputs.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\%\%/${{ inputs.channel }}/g;' src/Ryujinx.Common/ReleaseInformation.cs + sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ inputs.owner }}/g;' src/Ryujinx.Common/ReleaseInformation.cs + sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ inputs.repo }}/g;' src/Ryujinx.Common/ReleaseInformation.cs + shell: bash + + - name: Create output dir + run: "mkdir release_output" + shell: bash + + - name: Publish + if: ${{ steps.rid.outputs.os != 'osx' }} + run: | + dotnet publish -c Release -r "${{ inputs.rid }}" -o ./publish_gtk/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 "${{ inputs.rid }}" -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 + dotnet publish -c Release -r "${{ inputs.rid }}" -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.Ava --self-contained true + shell: bash + + - name: Packing Windows builds + if: ${{ startsWith(steps.rid.outputs.os, 'win') }} + run: | + pushd publish_gtk + 7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-win_${{ steps.rid.outputs.arch }}.zip publish + popd + + pushd publish_sdl2_headless + 7z a ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-win_${{ steps.rid.outputs.arch }}.zip publish + popd + + pushd publish_ava + 7z a ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-win_${{ steps.rid.outputs.arch }}.zip publish + popd + shell: bash + + - name: Packing Linux builds + if: ${{ steps.rid.outputs.os == 'linux' }} + run: | + pushd publish_gtk + chmod +x publish/Ryujinx.sh publish/Ryujinx + tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_${{ steps.rid.outputs.arch }}.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 }}-linux_${{ steps.rid.outputs.arch }}.tar.gz publish + popd + + pushd publish_ava + chmod +x publish/Ryujinx.sh publish/Ryujinx.Ava + tar -czvf ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-linux_${{ steps.rid.outputs.arch }}.tar.gz publish + popd + shell: bash + + - name: Publish macOS + if: ${{ steps.rid.outputs.os == 'osx' }} + 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 + ./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 + mv ./publish_ava/*.tar.gz ./release_output/ + mv ./publish_headless/*.tar.gz ./release_output/ + shell: bash diff --git a/.github/workflows/release-stage.yml b/.github/workflows/release-stage.yml new file mode 100644 index 000000000..943a8169c --- /dev/null +++ b/.github/workflows/release-stage.yml @@ -0,0 +1,109 @@ +name: Release staging build + +on: + workflow_dispatch: + inputs: {} + push: + branches: [ master ] + paths-ignore: + - '.github/**' + - '*.yml' + - '*.json' + - '*.config' + - 'README.md' + +concurrency: release-master + +env: + POWERSHELL_TELEMETRY_OPTOUT: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + RYUJINX_BASE_VERSION: "1.1" + RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "staging" + RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "Ryujinx" + RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "release-channel-staging" + +jobs: + tag: + name: Create tag + runs-on: ubuntu-latest + steps: + - 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 + uses: actions/github-script@v6 + with: + script: | + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: 'refs/tags/${{ steps.version_info.outputs.build_version }}', + sha: context.sha + }) + + release: + name: Release ${{ matrix.OS_NAME }} + runs-on: ${{ matrix.os }} + timeout-minutes: ${{ fromJSON(vars.JOB_TIMEOUT) }} + strategy: + matrix: + os: [ ubuntu-latest, ubuntu-latest, windows-latest ] + include: + - os: ubuntu-latest + OS_NAME: Linux x64 + DOTNET_RUNTIME_IDENTIFIER: linux-x64 + + - os: ubuntu-latest + OS_NAME: macOS universal + DOTNET_RUNTIME_IDENTIFIER: osx-universal + + - os: windows-latest + OS_NAME: Windows x64 + DOTNET_RUNTIME_IDENTIFIER: win10-x64 + steps: + - uses: actions/checkout@v4 + + - name: Setup LLVM 14 + if: matrix.DOTNET_RUNTIME_IDENTIFIER == 'osx-universal' + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 14 + + - name: Install rcodesign + if: matrix.DOTNET_RUNTIME_IDENTIFIER == 'osx-universal' + 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: Prepare release + id: release + uses: ./.github/actions/ryujinx-release + with: + base_version: ${{ env.RYUJINX_BASE_VERSION }} + rid: ${{ matrix.DOTNET_RUNTIME_IDENTIFIER }} + channel: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }} + owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} + repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }} + + - name: Pushing new release + uses: ncipollo/release-action@v1 + with: + name: ${{ steps.release.outputs.build_version }} + artifacts: "release_output/*.tar.gz,release_output/*.zip" + tag: ${{ steps.release.outputs.build_version }} + allowUpdates: true + removeArtifacts: true + replacesArtifacts: true + owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} + repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }} + token: ${{ secrets.RELEASE_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 988264a31..3eafb98a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: {} push: - branches: [ master ] + branches: [ stable ] paths-ignore: - '.github/**' - '*.yml' @@ -12,157 +12,48 @@ on: - '*.config' - 'README.md' -concurrency: release +concurrency: release-stable 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_NAME: "stable" RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "Ryujinx" RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "release-channel-master" jobs: - tag: - name: Create tag - runs-on: ubuntu-latest - steps: - - 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 - uses: actions/github-script@v6 - with: - script: | - github.rest.git.createRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: 'refs/tags/${{ steps.version_info.outputs.build_version }}', - sha: context.sha - }) - release: name: Release ${{ matrix.OS_NAME }} runs-on: ${{ matrix.os }} timeout-minutes: ${{ fromJSON(vars.JOB_TIMEOUT) }} strategy: matrix: - os: [ ubuntu-latest, windows-latest ] + os: [ ubuntu-latest, ubuntu-latest, windows-latest ] include: - os: ubuntu-latest OS_NAME: Linux x64 DOTNET_RUNTIME_IDENTIFIER: linux-x64 - RELEASE_ZIP_OS_NAME: linux_x64 + + - os: ubuntu-latest + OS_NAME: macOS universal + DOTNET_RUNTIME_IDENTIFIER: osx-universal - os: windows-latest OS_NAME: Windows x64 DOTNET_RUNTIME_IDENTIFIER: win10-x64 - RELEASE_ZIP_OS_NAME: win_x64 steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v3 - with: - global-json-file: global.json - - - 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 - shell: bash - - - name: Create output dir - run: "mkdir release_output" - - - name: Publish - run: | - dotnet publish -c Release -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish_gtk/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.DOTNET_RUNTIME_IDENTIFIER }}" -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 - dotnet publish -c Release -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -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.Ava --self-contained true - - - name: Packing Windows builds - if: matrix.os == 'windows-latest' - run: | - pushd publish_gtk - 7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-win_x64.zip publish - popd - - pushd publish_sdl2_headless - 7z a ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-win_x64.zip publish - popd - - pushd publish_ava - 7z a ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-win_x64.zip publish - popd - shell: bash - - - name: Packing Linux builds - if: matrix.os == 'ubuntu-latest' - run: | - pushd publish_gtk - chmod +x publish/Ryujinx.sh publish/Ryujinx - tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.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 }}-linux_x64.tar.gz publish - popd - - pushd publish_ava - chmod +x publish/Ryujinx.sh publish/Ryujinx.Ava - tar -czvf ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz publish - popd - shell: bash - - - name: Pushing new release - uses: ncipollo/release-action@v1 - with: - name: ${{ steps.version_info.outputs.build_version }} - artifacts: "release_output/*.tar.gz,release_output/*.zip" - tag: ${{ 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)." - omitBodyDuringUpdate: true - allowUpdates: true - replacesArtifacts: true - owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} - repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }} - token: ${{ secrets.RELEASE_TOKEN }} - - macos_release: - name: Release MacOS universal - runs-on: ubuntu-latest - timeout-minutes: ${{ fromJSON(vars.JOB_TIMEOUT) }} - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-dotnet@v3 - with: - global-json-file: global.json - - name: Setup LLVM 14 + if: matrix.DOTNET_RUNTIME_IDENTIFIER == 'osx-universal' run: | wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh sudo ./llvm.sh 14 - name: Install rcodesign + if: matrix.DOTNET_RUNTIME_IDENTIFIER == 'osx-universal' 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' @@ -173,35 +64,22 @@ jobs: 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 - shell: bash - - - name: Publish macOS Ryujinx.Ava - 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: Prepare release + id: release + uses: ./.github/actions/ryujinx-release + with: + base_version: ${{ env.RYUJINX_BASE_VERSION }} + rid: ${{ matrix.DOTNET_RUNTIME_IDENTIFIER }} + channel: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }} + owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} + repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }} - name: Pushing new release uses: ncipollo/release-action@v1 with: - name: ${{ steps.version_info.outputs.build_version }} - artifacts: "publish_ava/*.tar.gz, publish_headless/*.tar.gz" - tag: ${{ steps.version_info.outputs.build_version }} + name: ${{ steps.release.outputs.build_version }} + artifacts: "release_output/*.tar.gz,release_output/*.zip" + tag: ${{ steps.release.outputs.build_version }} body: "For more information about this release please check out the official [Changelog](https://github.com/Ryujinx/Ryujinx/wiki/Changelog)." omitBodyDuringUpdate: true allowUpdates: true @@ -215,4 +93,4 @@ jobs: needs: release with: ryujinx_version: "1.1.${{ github.run_number }}" - secrets: inherit \ No newline at end of file + secrets: inherit