2020-11-15 10:27:15 -08:00
|
|
|
name: Build job
|
|
|
|
|
2019-12-22 11:36:24 -08:00
|
|
|
on:
|
2023-07-24 09:35:04 -07:00
|
|
|
workflow_call:
|
2020-11-15 10:27:15 -08:00
|
|
|
|
2023-05-11 08:36:53 -07:00
|
|
|
env:
|
|
|
|
POWERSHELL_TELEMETRY_OPTOUT: 1
|
|
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
|
|
|
RYUJINX_BASE_VERSION: "1.1.0"
|
|
|
|
|
2019-12-22 11:36:24 -08:00
|
|
|
jobs:
|
|
|
|
build:
|
2023-05-11 08:36:53 -07:00
|
|
|
name: ${{ matrix.OS_NAME }} (${{ matrix.configuration }})
|
2019-12-22 11:36:24 -08:00
|
|
|
runs-on: ${{ matrix.os }}
|
2023-05-28 02:34:57 -07:00
|
|
|
timeout-minutes: 45
|
2019-12-22 11:36:24 -08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macOS-latest, windows-latest]
|
2020-11-15 10:27:15 -08:00
|
|
|
configuration: [Debug, Release]
|
2021-02-28 02:56:15 -08:00
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
OS_NAME: Linux x64
|
|
|
|
DOTNET_RUNTIME_IDENTIFIER: linux-x64
|
2021-03-20 13:46:49 -07:00
|
|
|
RELEASE_ZIP_OS_NAME: linux_x64
|
2021-02-28 02:56:15 -08:00
|
|
|
|
|
|
|
- os: macOS-latest
|
2023-05-12 15:53:52 -07:00
|
|
|
OS_NAME: macOS x64
|
2021-02-28 02:56:15 -08:00
|
|
|
DOTNET_RUNTIME_IDENTIFIER: osx-x64
|
|
|
|
RELEASE_ZIP_OS_NAME: osx_x64
|
|
|
|
|
|
|
|
- os: windows-latest
|
|
|
|
OS_NAME: Windows x64
|
2023-11-15 08:41:31 -08:00
|
|
|
DOTNET_RUNTIME_IDENTIFIER: win-x64
|
2021-02-28 02:56:15 -08:00
|
|
|
RELEASE_ZIP_OS_NAME: win_x64
|
|
|
|
|
2020-11-15 10:27:15 -08:00
|
|
|
fail-fast: false
|
2019-12-22 11:36:24 -08:00
|
|
|
steps:
|
2023-09-04 13:16:17 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-05-11 08:36:53 -07:00
|
|
|
|
2022-10-21 01:31:38 -07:00
|
|
|
- uses: actions/setup-dotnet@v3
|
2019-12-22 11:36:24 -08:00
|
|
|
with:
|
2023-05-11 08:36:53 -07:00
|
|
|
global-json-file: global.json
|
2023-08-16 13:58:34 -07:00
|
|
|
|
|
|
|
- name: Overwrite csc problem matcher
|
|
|
|
run: echo "::add-matcher::.github/csc.json"
|
2023-05-11 08:36:53 -07:00
|
|
|
|
2021-02-28 02:56:15 -08:00
|
|
|
- name: Get git short hash
|
|
|
|
id: git_short_hash
|
2022-10-21 01:31:38 -07:00
|
|
|
run: echo "result=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
|
2022-10-29 12:00:08 -07:00
|
|
|
shell: bash
|
2023-05-11 08:36:53 -07:00
|
|
|
|
2019-12-22 11:36:24 -08:00
|
|
|
- name: Build
|
2022-11-17 09:30:54 -08: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 08:36:53 -07:00
|
|
|
|
2019-12-22 11:36:24 -08:00
|
|
|
- name: Test
|
2023-07-31 15:15:37 -07:00
|
|
|
uses: TSRBerry/unstable-commands@v1
|
|
|
|
with:
|
|
|
|
commands: dotnet test --no-build -c "${{ matrix.configuration }}"
|
|
|
|
timeout-minutes: 10
|
|
|
|
retry-codes: 139
|
2023-05-11 08:36:53 -07:00
|
|
|
|
2021-07-06 13:08:44 -07:00
|
|
|
- name: Publish Ryujinx
|
2023-04-25 20:12:19 -07:00
|
|
|
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -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 true
|
2023-05-12 15:53:52 -07:00
|
|
|
if: github.event_name == 'pull_request' && matrix.os != 'macOS-latest'
|
2023-05-11 08:36:53 -07:00
|
|
|
|
2021-07-06 13:08:44 -07:00
|
|
|
- name: Publish Ryujinx.Headless.SDL2
|
2023-04-25 20:12:19 -07:00
|
|
|
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -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 true
|
2023-05-12 15:53:52 -07:00
|
|
|
if: github.event_name == 'pull_request' && matrix.os != 'macOS-latest'
|
2023-05-11 08:36:53 -07:00
|
|
|
|
2022-05-15 04:30:15 -07:00
|
|
|
- name: Publish Ryujinx.Ava
|
2023-04-25 20:12:19 -07:00
|
|
|
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish_ava -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx.Ava --self-contained true
|
2023-05-12 15:53:52 -07:00
|
|
|
if: github.event_name == 'pull_request' && matrix.os != 'macOS-latest'
|
2023-05-11 08:36:53 -07: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
|
|
|
|
chmod +x ./publish_ava/Ryujinx.Ava ./publish_ava/Ryujinx.sh
|
|
|
|
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
|
|
|
|
|
2021-07-06 13:08:44 -07:00
|
|
|
- name: Upload Ryujinx artifact
|
2022-10-21 01:31:38 -07:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-02-28 02:56:15 -08:00
|
|
|
with:
|
2022-05-03 14:35:12 -07:00
|
|
|
name: ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
|
2021-03-20 13:46:49 -07:00
|
|
|
path: publish
|
2023-05-12 15:53:52 -07:00
|
|
|
if: github.event_name == 'pull_request' && matrix.os != 'macOS-latest'
|
2023-05-11 08:36:53 -07:00
|
|
|
|
2021-07-06 13:08:44 -07:00
|
|
|
- name: Upload Ryujinx.Headless.SDL2 artifact
|
2022-10-21 01:31:38 -07:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-07-06 13:08:44 -07:00
|
|
|
with:
|
2022-05-15 04:30:15 -07:00
|
|
|
name: sdl2-ryujinx-headless-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
|
2021-07-06 13:08:44 -07:00
|
|
|
path: publish_sdl2_headless
|
2023-05-12 15:53:52 -07:00
|
|
|
if: github.event_name == 'pull_request' && matrix.os != 'macOS-latest'
|
2023-05-11 08:36:53 -07:00
|
|
|
|
2022-05-15 04:30:15 -07:00
|
|
|
- name: Upload Ryujinx.Ava artifact
|
2022-10-21 01:31:38 -07:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-05-15 04:30:15 -07:00
|
|
|
with:
|
|
|
|
name: ava-ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
|
|
|
|
path: publish_ava
|
2023-05-12 15:53:52 -07:00
|
|
|
if: github.event_name == 'pull_request' && matrix.os != 'macOS-latest'
|
2023-05-11 08:36:53 -07:00
|
|
|
|
|
|
|
build_macos:
|
2023-05-12 15:53:52 -07:00
|
|
|
name: macOS Universal (${{ matrix.configuration }})
|
2023-05-11 08:36:53 -07:00
|
|
|
runs-on: ubuntu-latest
|
2023-05-28 02:34:57 -07:00
|
|
|
timeout-minutes: 45
|
2023-05-11 08:36:53 -07:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
configuration: [ Debug, Release ]
|
|
|
|
|
|
|
|
steps:
|
2023-09-04 13:16:17 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-05-11 08:36:53 -07:00
|
|
|
|
|
|
|
- uses: actions/setup-dotnet@v3
|
|
|
|
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
|
|
|
|
|
2023-09-04 16:28:44 -07:00
|
|
|
- name: Publish macOS Ryujinx.Ava
|
2023-05-11 08:36:53 -07:00
|
|
|
run: |
|
2023-09-04 16:28:44 -07:00
|
|
|
./distribution/macos/create_macos_build_ava.sh . publish_tmp_ava publish_ava ./distribution/macos/entitlements.xml "${{ env.RYUJINX_BASE_VERSION }}" "${{ steps.git_short_hash.outputs.result }}" "${{ matrix.configuration }}" "-p:ExtraDefineConstants=DISABLE_UPDATER"
|
|
|
|
|
|
|
|
- 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 08:36:53 -07:00
|
|
|
|
|
|
|
- name: Upload Ryujinx.Ava artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ava-ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-macos_universal
|
|
|
|
path: "publish_ava/*.tar.gz"
|
2023-07-31 15:15:37 -07:00
|
|
|
if: github.event_name == 'pull_request'
|
2023-09-04 16:28:44 -07:00
|
|
|
|
|
|
|
- name: Upload Ryujinx.Headless.SDL2 artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
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 08:41:31 -08:00
|
|
|
if: github.event_name == 'pull_request'
|