Ryujinx/.github/actions/ryujinx-release/action.yml
2023-10-07 13:24:29 +02:00

121 lines
7 KiB
YAML

name: Create Ryujinx release builds
description: Prepares everything for a new release
inputs:
version:
description: Version
default: "1.0.0"
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
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 "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\%\%/${{ 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
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="${{ 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-${{ inputs.version }}-win_${{ steps.rid.outputs.arch }}.zip publish
popd
pushd publish_sdl2_headless
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-${{ inputs.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
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
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
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
- 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