Improve staging build version numbers

This commit is contained in:
TSR Berry 2023-04-04 16:42:03 +02:00
parent 4026898155
commit 38636c352c
No known key found for this signature in database
GPG key ID: 52353C0A4CCA15E2
3 changed files with 61 additions and 53 deletions

View file

@ -2,9 +2,9 @@ name: Create Ryujinx release builds
description: Prepares everything for a new release description: Prepares everything for a new release
inputs: inputs:
base_version: version:
description: Base version description: Version
default: "1.1" default: "1.0.0"
required: true required: true
rid: rid:
description: .NET runtime identifier or 'osx-universal' description: .NET runtime identifier or 'osx-universal'
@ -22,11 +22,6 @@ inputs:
default: "release-channel-master" default: "release-channel-master"
required: true required: true
outputs:
build_version:
description: Build version
value: ${{ steps.version_info.outputs.build_version }}
runs: runs:
using: composite using: composite
steps: steps:
@ -48,13 +43,12 @@ runs:
- name: Get version info - name: Get version info
id: version_info id: version_info
run: | run: |
echo "build_version=${{ inputs.base_version }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
shell: bash shell: bash
- name: Configure for release - name: Configure for release
run: | 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_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_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_OWNER\%\%/${{ inputs.owner }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
@ -62,30 +56,30 @@ runs:
shell: bash shell: bash
- name: Create output dir - name: Create output dir
run: "mkdir release_output" run: mkdir release_output
shell: bash shell: bash
- name: Publish - name: Publish
if: ${{ steps.rid.outputs.os != 'osx' }} if: ${{ steps.rid.outputs.os != 'osx' }}
run: | 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_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="${{ 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_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="${{ 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_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 shell: bash
- name: Packing Windows builds - name: Packing Windows builds
if: ${{ startsWith(steps.rid.outputs.os, 'win') }} if: ${{ startsWith(steps.rid.outputs.os, 'win') }}
run: | run: |
pushd publish_gtk 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 popd
pushd publish_sdl2_headless 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 popd
pushd publish_ava 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 popd
shell: bash shell: bash
@ -93,18 +87,27 @@ runs:
if: ${{ steps.rid.outputs.os == 'linux' }} if: ${{ steps.rid.outputs.os == 'linux' }}
run: | run: |
pushd publish_gtk pushd publish_gtk
chmod +x publish/Ryujinx.sh publish/Ryujinx tar --exclude "publish/Ryujinx" --exclude "publish/Ryujinx.sh" -cvf ../release_output/ryujinx-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar publish
tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_${{ steps.rid.outputs.arch }}.tar.gz 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 popd
pushd publish_sdl2_headless pushd publish_sdl2_headless
chmod +x publish/Ryujinx.sh publish/Ryujinx.Headless.SDL2 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
tar -czvf ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-linux_${{ steps.rid.outputs.arch }}.tar.gz 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 popd
pushd publish_ava pushd publish_ava
chmod +x publish/Ryujinx.sh publish/Ryujinx.Ava tar --exclude "publish/Ryujinx.Ava" --exclude "publish/Ryujinx.sh" -cvf ../release_output/test-ava-ryujinx-${{ inputs.version }}-linux_${{ steps.rid.outputs.arch }}.tar publish
tar -czvf ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-linux_${{ steps.rid.outputs.arch }}.tar.gz 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 popd
shell: bash shell: bash

View file

@ -16,12 +16,27 @@ concurrency: release-stable
env: env:
POWERSHELL_TELEMETRY_OPTOUT: 1 POWERSHELL_TELEMETRY_OPTOUT: 1
DOTNET_CLI_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_NAME: "stable"
RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "Ryujinx" RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "Ryujinx"
RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "release-channel-master" RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "release-channel-master"
jobs: 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: release:
name: Release ${{ matrix.OS_NAME }} name: Release ${{ matrix.OS_NAME }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -67,7 +82,7 @@ jobs:
id: release id: release
uses: ./.github/actions/ryujinx-release uses: ./.github/actions/ryujinx-release
with: with:
base_version: ${{ env.RYUJINX_BASE_VERSION }} version: ${{ env.RYUJINX_VERSION }}
rid: ${{ matrix.DOTNET_RUNTIME_IDENTIFIER }} rid: ${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}
channel: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }} channel: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}
owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
@ -76,9 +91,9 @@ jobs:
- name: Pushing new release - name: Pushing new release
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
with: with:
name: ${{ steps.release.outputs.build_version }} name: ${{ env.RYUJINX_VERSION }}
artifacts: "release_output/*.tar.gz,release_output/*.zip" 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)." body: "For more information about this release please check out the official [Changelog](https://github.com/Ryujinx/Ryujinx/wiki/Changelog)."
omitBodyDuringUpdate: true omitBodyDuringUpdate: true
allowUpdates: true allowUpdates: true
@ -91,5 +106,5 @@ jobs:
uses: ./.github/workflows/flatpak.yml uses: ./.github/workflows/flatpak.yml
needs: release needs: release
with: with:
ryujinx_version: "1.1.${{ github.run_number }}" ryujinx_version: ${{ env.RYUJINX_VERSION }}
secrets: inherit secrets: inherit

View file

@ -16,33 +16,11 @@ concurrency: release-master
env: env:
POWERSHELL_TELEMETRY_OPTOUT: 1 POWERSHELL_TELEMETRY_OPTOUT: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1
RYUJINX_BASE_VERSION: "1.1"
RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "staging" RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "staging"
RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "Ryujinx" RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "Ryujinx"
RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "release-channel-staging" RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "release-channel-staging"
jobs: 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: release:
name: Release ${{ matrix.OS_NAME }} name: Release ${{ matrix.OS_NAME }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -84,11 +62,23 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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 - name: Prepare release
id: release id: release
uses: ./.github/actions/ryujinx-release uses: ./.github/actions/ryujinx-release
with: with:
base_version: ${{ env.RYUJINX_BASE_VERSION }} version: ${{ steps.version.outputs.version }}
rid: ${{ matrix.DOTNET_RUNTIME_IDENTIFIER }} rid: ${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}
channel: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }} channel: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}
owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
@ -97,9 +87,9 @@ jobs:
- name: Pushing new release - name: Pushing new release
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
with: with:
name: ${{ steps.release.outputs.build_version }} name: ${{ steps.version.outputs.version }}
artifacts: "release_output/*.tar.gz,release_output/*.zip" artifacts: "release_output/*.tar.gz,release_output/*.zip"
tag: ${{ steps.release.outputs.build_version }} tag: ${{ steps.version.outputs.version }}
allowUpdates: true allowUpdates: true
removeArtifacts: true removeArtifacts: true
replacesArtifacts: true replacesArtifacts: true