2020-11-15 19:27:15 +01:00
|
|
|
name: Build job
|
|
|
|
|
2019-12-22 20:36:24 +01:00
|
|
|
on:
|
2023-07-24 18:35:04 +02:00
|
|
|
workflow_call:
|
2020-11-15 19:27:15 +01:00
|
|
|
|
2023-05-11 17:36:53 +02:00
|
|
|
env:
|
|
|
|
POWERSHELL_TELEMETRY_OPTOUT: 1
|
|
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
2024-10-12 00:56:59 +02:00
|
|
|
RYUJINX_BASE_VERSION: "1.2.0"
|
2024-10-26 14:36:33 +02:00
|
|
|
RELEASE: 0
|
2023-05-11 17:36:53 +02:00
|
|
|
|
2019-12-22 20:36:24 +01:00
|
|
|
jobs:
|
|
|
|
build:
|
2024-02-10 22:05:46 +01:00
|
|
|
name: ${{ matrix.platform.name }} (${{ matrix.configuration }})
|
|
|
|
runs-on: ${{ matrix.platform.os }}
|
2023-05-28 11:34:57 +02:00
|
|
|
timeout-minutes: 45
|
2019-12-22 20:36:24 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-11-15 19:27:15 +01:00
|
|
|
configuration: [Debug, Release]
|
2024-02-10 22:05:46 +01:00
|
|
|
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 }
|
2024-04-27 01:36:35 +02:00
|
|
|
- { name: osx-x64, os: macos-13, zip_os_name: osx_x64 }
|
2021-02-28 11:56:15 +01:00
|
|
|
|
2020-11-15 19:27:15 +01:00
|
|
|
fail-fast: false
|
2019-12-22 20:36:24 +01:00
|
|
|
steps:
|
2023-09-04 22:16:17 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-05-11 17:36:53 +02:00
|
|
|
|
2023-12-04 19:15:30 +01:00
|
|
|
- uses: actions/setup-dotnet@v4
|
2019-12-22 20:36:24 +01:00
|
|
|
with:
|
2023-05-11 17:36:53 +02:00
|
|
|
global-json-file: global.json
|
2024-01-29 19:58:18 +01:00
|
|
|
|
2023-08-16 22:58:34 +02:00
|
|
|
- name: Overwrite csc problem matcher
|
|
|
|
run: echo "::add-matcher::.github/csc.json"
|
2023-05-11 17:36:53 +02:00
|
|
|
|
2021-02-28 11:56:15 +01:00
|
|
|
- name: Get git short hash
|
|
|
|
id: git_short_hash
|
2022-10-21 10:31:38 +02:00
|
|
|
run: echo "result=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
|
2022-10-29 21:00:08 +02:00
|
|
|
shell: bash
|
2023-05-11 17:36:53 +02:00
|
|
|
|
2024-01-29 19:58:18 +01:00
|
|
|
- name: Change config filename
|
|
|
|
run: sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/PRConfig\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
|
|
|
shell: bash
|
2024-04-27 01:36:35 +02:00
|
|
|
if: github.event_name == 'pull_request' && matrix.platform.os != 'macos-13'
|
2024-01-29 19:58:18 +01:00
|
|
|
|
|
|
|
- name: Change config filename for macOS
|
|
|
|
run: sed -r -i '' 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/PRConfig\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
|
|
|
shell: bash
|
2024-04-27 01:36:35 +02:00
|
|
|
if: github.event_name == 'pull_request' && matrix.platform.os == 'macos-13'
|
2024-01-29 19:58:18 +01:00
|
|
|
|
2019-12-22 20:36:24 +01:00
|
|
|
- name: Build
|
2022-11-17 18:30:54 +01:00
|
|
|
run: dotnet build -c "${{ matrix.configuration }}" -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER
|
2023-05-11 17:36:53 +02:00
|
|
|
|
2019-12-22 20:36:24 +01:00
|
|
|
- name: Test
|
2023-08-01 00:15:37 +02:00
|
|
|
uses: TSRBerry/unstable-commands@v1
|
|
|
|
with:
|
|
|
|
commands: dotnet test --no-build -c "${{ matrix.configuration }}"
|
|
|
|
timeout-minutes: 10
|
|
|
|
retry-codes: 139
|
2024-02-10 22:05:46 +01:00
|
|
|
if: matrix.platform.name != 'linux-arm64'
|
2023-05-11 17:36:53 +02:00
|
|
|
|
2021-07-06 22:08:44 +02:00
|
|
|
- name: Publish Ryujinx
|
2024-11-01 22:04:32 +01:00
|
|
|
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.platform.name }}" -o ./publish -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx --self-contained
|
2024-04-27 01:36:35 +02:00
|
|
|
if: github.event_name == 'pull_request' && matrix.platform.os != 'macos-13'
|
2023-05-11 17:36:53 +02:00
|
|
|
|
2021-07-06 22:08:44 +02:00
|
|
|
- name: Publish Ryujinx.Headless.SDL2
|
2024-11-01 22:04:32 +01:00
|
|
|
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.platform.name }}" -o ./publish_sdl2_headless -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx.Headless.SDL2 --self-contained
|
2024-04-27 01:36:35 +02:00
|
|
|
if: github.event_name == 'pull_request' && matrix.platform.os != 'macos-13'
|
2023-05-11 17:36:53 +02:00
|
|
|
|
|
|
|
- name: Set executable bit
|
|
|
|
run: |
|
|
|
|
chmod +x ./publish/Ryujinx ./publish/Ryujinx.sh
|
|
|
|
chmod +x ./publish_sdl2_headless/Ryujinx.Headless.SDL2 ./publish_sdl2_headless/Ryujinx.sh
|
2024-02-10 22:05:46 +01:00
|
|
|
if: github.event_name == 'pull_request' && matrix.platform.os == 'ubuntu-latest'
|
2023-05-11 17:36:53 +02:00
|
|
|
|
2024-11-10 02:30:19 +01:00
|
|
|
- name: Build AppImage
|
|
|
|
if: github.event_name == 'pull_request' && matrix.platform.os == 'ubuntu-latest'
|
|
|
|
run: |
|
|
|
|
PLATFORM_NAME="${{ matrix.platform.name }}"
|
2024-10-26 14:31:37 +02:00
|
|
|
|
2024-11-10 02:30:19 +01:00
|
|
|
sudo apt install -y zsync desktop-file-utils appstream
|
2024-10-26 14:31:37 +02:00
|
|
|
|
2024-11-10 02:30:19 +01:00
|
|
|
mkdir -p tools
|
|
|
|
export PATH="$PATH:$(readlink -f tools)"
|
2024-10-26 14:31:37 +02:00
|
|
|
|
2024-11-10 02:30:19 +01:00
|
|
|
# Setup appimagetool
|
|
|
|
wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
|
|
|
|
chmod +x tools/appimagetool
|
|
|
|
chmod +x distribution/linux/appimage/build-appimage.sh
|
2024-10-26 14:31:37 +02:00
|
|
|
|
|
|
|
# Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name)
|
2024-11-10 02:30:19 +01:00
|
|
|
if [ "$PLATFORM_NAME" = "linux-x64" ]; then
|
|
|
|
ARCH_NAME=x64
|
|
|
|
export ARCH=x86_64
|
|
|
|
elif [ "$PLATFORM_NAME" = "linux-arm64" ]; then
|
|
|
|
ARCH_NAME=arm64
|
|
|
|
export ARCH=aarch64
|
|
|
|
else
|
|
|
|
echo "Unexpected PLATFORM_NAME "$PLATFORM_NAME""
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync"
|
|
|
|
BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh
|
|
|
|
shell: bash
|
2024-10-26 14:31:37 +02:00
|
|
|
|
2021-07-06 22:08:44 +02:00
|
|
|
- name: Upload Ryujinx artifact
|
2023-12-25 06:33:10 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-02-28 11:56:15 +01:00
|
|
|
with:
|
2024-02-10 22:05:46 +01:00
|
|
|
name: ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.platform.zip_os_name }}
|
2021-03-20 21:46:49 +01:00
|
|
|
path: publish
|
2024-04-27 01:36:35 +02:00
|
|
|
if: github.event_name == 'pull_request' && matrix.platform.os != 'macos-13'
|
2023-05-11 17:36:53 +02:00
|
|
|
|
2024-11-10 02:30:19 +01:00
|
|
|
- name: Upload Ryujinx (AppImage) artifact
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
if: github.event_name == 'pull_request' && matrix.platform.os == 'ubuntu-latest'
|
|
|
|
with:
|
|
|
|
name: ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.platform.zip_os_name }}-AppImage
|
|
|
|
path: publish_appimage
|
2024-10-26 14:31:37 +02:00
|
|
|
|
2021-07-06 22:08:44 +02:00
|
|
|
- name: Upload Ryujinx.Headless.SDL2 artifact
|
2023-12-25 06:33:10 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-07-06 22:08:44 +02:00
|
|
|
with:
|
2024-02-10 22:05:46 +01:00
|
|
|
name: sdl2-ryujinx-headless-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.platform.zip_os_name }}
|
2021-07-06 22:08:44 +02:00
|
|
|
path: publish_sdl2_headless
|
2024-04-27 01:36:35 +02:00
|
|
|
if: github.event_name == 'pull_request' && matrix.platform.os != 'macos-13'
|
2023-05-11 17:36:53 +02:00
|
|
|
|
|
|
|
build_macos:
|
2023-05-13 00:53:52 +02:00
|
|
|
name: macOS Universal (${{ matrix.configuration }})
|
2023-05-11 17:36:53 +02:00
|
|
|
runs-on: ubuntu-latest
|
2023-05-28 11:34:57 +02:00
|
|
|
timeout-minutes: 45
|
2023-05-11 17:36:53 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
configuration: [ Debug, Release ]
|
|
|
|
|
|
|
|
steps:
|
2023-09-04 22:16:17 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-05-11 17:36:53 +02:00
|
|
|
|
2023-12-04 19:15:30 +01:00
|
|
|
- uses: actions/setup-dotnet@v4
|
2023-05-11 17:36:53 +02:00
|
|
|
with:
|
|
|
|
global-json-file: global.json
|
|
|
|
|
|
|
|
- name: Setup LLVM 14
|
|
|
|
run: |
|
|
|
|
wget https://apt.llvm.org/llvm.sh
|
|
|
|
chmod +x llvm.sh
|
|
|
|
sudo ./llvm.sh 14
|
|
|
|
|
|
|
|
- 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 git short hash
|
|
|
|
id: git_short_hash
|
|
|
|
run: echo "result=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
|
|
|
|
|
2024-01-29 19:58:18 +01:00
|
|
|
- name: Change config filename
|
|
|
|
run: sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/PRConfig\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
|
|
|
shell: bash
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
|
2024-03-02 12:51:05 +01:00
|
|
|
- name: Publish macOS Ryujinx
|
2023-05-11 17:36:53 +02:00
|
|
|
run: |
|
2024-03-02 12:51:05 +01:00
|
|
|
./distribution/macos/create_macos_build_ava.sh . publish_tmp publish ./distribution/macos/entitlements.xml "${{ env.RYUJINX_BASE_VERSION }}" "${{ steps.git_short_hash.outputs.result }}" "${{ matrix.configuration }}" "-p:ExtraDefineConstants=DISABLE_UPDATER"
|
2023-09-05 01:28:44 +02:00
|
|
|
|
|
|
|
- name: Publish macOS Ryujinx.Headless.SDL2
|
|
|
|
run: |
|
|
|
|
./distribution/macos/create_macos_build_headless.sh . publish_tmp_headless publish_headless ./distribution/macos/entitlements.xml "${{ env.RYUJINX_BASE_VERSION }}" "${{ steps.git_short_hash.outputs.result }}" "${{ matrix.configuration }}" "-p:ExtraDefineConstants=DISABLE_UPDATER"
|
2023-05-11 17:36:53 +02:00
|
|
|
|
2024-03-02 12:51:05 +01:00
|
|
|
- name: Upload Ryujinx artifact
|
2023-12-25 06:33:10 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-05-11 17:36:53 +02:00
|
|
|
with:
|
2024-03-02 12:51:05 +01:00
|
|
|
name: ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-macos_universal
|
|
|
|
path: "publish/*.tar.gz"
|
2023-08-01 00:15:37 +02:00
|
|
|
if: github.event_name == 'pull_request'
|
2023-09-05 01:28:44 +02:00
|
|
|
|
|
|
|
- name: Upload Ryujinx.Headless.SDL2 artifact
|
2023-12-25 06:33:10 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-09-05 01:28:44 +02:00
|
|
|
with:
|
|
|
|
name: sdl2-ryujinx-headless-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-macos_universal
|
|
|
|
path: "publish_headless/*.tar.gz"
|
2023-11-15 17:41:31 +01:00
|
|
|
if: github.event_name == 'pull_request'
|