diff --git a/.github/actions/ryujinx-release/action.yml b/.github/actions/ryujinx-release/action.yml index 9e7803b29..3b0a07146 100644 --- a/.github/actions/ryujinx-release/action.yml +++ b/.github/actions/ryujinx-release/action.yml @@ -2,9 +2,9 @@ name: Create Ryujinx release builds description: Prepares everything for a new release inputs: - base_version: - description: Base version - default: "1.1" + version: + description: Version + default: "1.0.0" required: true rid: description: .NET runtime identifier or 'osx-universal' @@ -22,11 +22,6 @@ inputs: default: "release-channel-master" required: true -outputs: - build_version: - description: Build version - value: ${{ steps.version_info.outputs.build_version }} - runs: using: composite steps: @@ -48,13 +43,12 @@ runs: - 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_VERSION\%\%/${{ inputs.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 @@ -62,30 +56,30 @@ runs: shell: bash - name: Create output dir - run: "mkdir release_output" + 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 + dotnet publish -c Release -r "${{ inputs.rid }}" -o ./publish_gtk/publish -p:Version="${{ inputs.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="${{ inputs.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="${{ inputs.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 + 7z a ../release_output/ryujinx-${{ inputs.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 + 7z a ../release_output/sdl2-ryujinx-headless-${{ inputs.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 + 7z a ../release_output/test-ava-ryujinx-${{ inputs.version }}-win_${{ steps.rid.outputs.arch }}.zip publish popd shell: bash @@ -93,18 +87,27 @@ runs: 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 + tar --exclude "publish/Ryujinx" --exclude "publish/Ryujinx.sh" -cvf ../release_output/ryujinx-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar publish + python3 ../distribution/misc/add_tar_exec.py ../release_output/ryujinx-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar "publish/Ryujinx" "publish/Ryujinx" + python3 ../distribution/misc/add_tar_exec.py ../release_output/ryujinx-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar "publish/Ryujinx.sh" "publish/Ryujinx.sh" + gzip -9 < ../release_output/ryujinx-${{ inputs.version }}-linux_x64.tar > ../release_output/ryujinx-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar.gz + rm ../release_output/ryujinx-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar 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 + tar --exclude "publish/Ryujinx.Headless.SDL2" --exclude "publish/Ryujinx.sh" -cvf ../release_output/sdl2-ryujinx-headless-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar publish + python3 ../distribution/misc/add_tar_exec.py ../release_output/sdl2-ryujinx-headless-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar "publish/Ryujinx.Headless.SDL2" "publish/Ryujinx.Headless.SDL2" + python3 ../distribution/misc/add_tar_exec.py ../release_output/sdl2-ryujinx-headless-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar "publish/Ryujinx.sh" "publish/Ryujinx.sh" + gzip -9 < ../release_output/sdl2-ryujinx-headless-${{ inputs.version }}-linux_x64.tar > ../release_output/sdl2-ryujinx-headless-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar.gz + rm ../release_output/sdl2-ryujinx-headless-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar 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 + tar --exclude "publish/Ryujinx.Ava" --exclude "publish/Ryujinx.sh" -cvf ../release_output/test-ava-ryujinx-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar publish + python3 ../distribution/misc/add_tar_exec.py ../release_output/test-ava-ryujinx-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar "publish/Ryujinx.Ava" "publish/Ryujinx.Ava" + python3 ../distribution/misc/add_tar_exec.py ../release_output/test-ava-ryujinx-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar "publish/Ryujinx.sh" "publish/Ryujinx.sh" + gzip -9 < ../release_output/test-ava-ryujinx-${{ inputs.version }}-linux_x64.tar > ../release_output/test-ava-ryujinx-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar.gz + rm ../release_output/test-ava-ryujinx-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar popd shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01fac2dab..8658d55c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,12 +16,27 @@ concurrency: release-stable env: POWERSHELL_TELEMETRY_OPTOUT: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1 - RYUJINX_BASE_VERSION: "1.1" + RYUJINX_VERSION: "1.1.${{ github.run_number }}" 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: Create tag + uses: actions/github-script@v6 + with: + script: | + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: 'refs/tags/${{ env.RYUJINX_VERSION }}', + sha: context.sha + }) + release: name: Release ${{ matrix.OS_NAME }} runs-on: ${{ matrix.os }} @@ -67,7 +82,7 @@ jobs: id: release uses: ./.github/actions/ryujinx-release with: - base_version: ${{ env.RYUJINX_BASE_VERSION }} + version: ${{ env.RYUJINX_VERSION }} rid: ${{ matrix.DOTNET_RUNTIME_IDENTIFIER }} channel: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }} owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} @@ -76,9 +91,9 @@ jobs: - name: Pushing new release uses: ncipollo/release-action@v1 with: - name: ${{ steps.release.outputs.build_version }} + name: ${{ env.RYUJINX_VERSION }} artifacts: "release_output/*.tar.gz,release_output/*.zip" - tag: ${{ steps.release.outputs.build_version }} + tag: ${{ env.RYUJINX_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 @@ -91,5 +106,5 @@ jobs: uses: ./.github/workflows/flatpak.yml needs: release with: - ryujinx_version: "1.1.${{ github.run_number }}" + ryujinx_version: ${{ env.RYUJINX_VERSION }} secrets: inherit diff --git a/.github/workflows/release_stage.yml b/.github/workflows/release_stage.yml index 8fcd03106..ebe2de03b 100644 --- a/.github/workflows/release_stage.yml +++ b/.github/workflows/release_stage.yml @@ -16,33 +16,11 @@ 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 }} @@ -84,11 +62,23 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Get version + id: version + run: | + base_version=$(gh api /repos/$REPO/tags --jq '.[0].name') + version_suffix=$(gh api /repos/$RELEASE_REPO/tags --jq 'map(select(.name | startswith("'$base_version'."))) | (.[0].name | split(".")[-1] | tonumber | . + 1) // 1') + echo "version=$base_version.$version_suffix" >> "$GITHUB_OUTPUT" + shell: bash + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + RELEASE_REPO: "${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}" + - name: Prepare release id: release uses: ./.github/actions/ryujinx-release with: - base_version: ${{ env.RYUJINX_BASE_VERSION }} + version: ${{ steps.version.outputs.version }} rid: ${{ matrix.DOTNET_RUNTIME_IDENTIFIER }} channel: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }} owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} @@ -97,9 +87,9 @@ jobs: - name: Pushing new release uses: ncipollo/release-action@v1 with: - name: ${{ steps.release.outputs.build_version }} + name: ${{ steps.version.outputs.version }} artifacts: "release_output/*.tar.gz,release_output/*.zip" - tag: ${{ steps.release.outputs.build_version }} + tag: ${{ steps.version.outputs.version }} allowUpdates: true removeArtifacts: true replacesArtifacts: true