Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Build stuff

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Debug]
include:
- os: windows-latest
c_compiler: clang-cl
cpp_compiler: clang-cl
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Ninja (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y ninja-build
shell: bash

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bash is the default shell for Linux.

Suggested change
shell: bash


- name: Install Ninja (Windows)
if: runner.os == 'Windows'
run: choco install ninja
shell: powershell

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PowerShell is the default for Windows.

Suggested change
shell: powershell


- name: Configure CMake (Linux)
if: runner.os == 'Linux'
run: >
cmake
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-G Ninja
-S .
shell: bash

- name: Configure CMake (Windows)
if: runner.os == 'Windows'
run: >
cmake
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-G Ninja
-S .
shell: powershell
Comment on lines +39 to +59

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the same.

Suggested change
- name: Configure CMake (Linux)
if: runner.os == 'Linux'
run: >
cmake
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-G Ninja
-S .
shell: bash
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
run: >
cmake
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-G Ninja
-S .
shell: powershell
- name: Configure CMake
run: cmake -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -GNinja -S .



- name: Build
run: ninja




- name: Package Artifacts (Linux)
if: runner.os == 'Linux'
run: |
mkdir -p artifacts
cp XenonRecomp/XenonRecomp artifacts/
cp XenonAnalyse/XenonAnalyse artifacts/
shell: bash
Comment on lines +72 to +74

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cp XenonRecomp/XenonRecomp artifacts/
cp XenonAnalyse/XenonAnalyse artifacts/
shell: bash
cp XenonRecomp/XenonRecomp XenonAnalyse/XenonAnalyse artifacts


- name: Package Artifacts (Windows)
if: runner.os == 'Windows'
run: |
New-Item -ItemType Directory -Path artifacts
Copy-Item -Path XenonRecomp\XenonRecomp.exe -Destination artifacts\
Copy-Item -Path XenonAnalyse\XenonAnalyse.exe -Destination artifacts\
shell: powershell
Comment on lines +80 to +82

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Copy-Item -Path XenonRecomp\XenonRecomp.exe -Destination artifacts\
Copy-Item -Path XenonAnalyse\XenonAnalyse.exe -Destination artifacts\
shell: powershell
Copy-Item XenonRecomp\XenonRecomp.exe XenonAnalyse\XenonAnalyse.exe artifacts


- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: XenonBinaries-${{ matrix.os }}
path: artifacts/*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
path: artifacts/*
path: artifacts/*
if-no-files-found: error

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Linux Build Artifacts
uses: actions/download-artifact@v4
with:
name: XenonBinaries-ubuntu-latest
path: artifacts

- name: Download Windows Build Artifacts
uses: actions/download-artifact@v4
with:
name: XenonBinaries-windows-latest
path: artifacts

- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v2
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
body: |
**Automated release for** ${{ github.ref_name }}

- Includes builds for **Linux** and **Windows**.
draft: false
prerelease: false
Comment on lines +116 to +117

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These default to false.

Suggested change
draft: false
prerelease: false

files: |
artifacts/XenonBinaries-ubuntu-latest.zip
artifacts/XenonBinaries-windows-latest.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,4 @@ On Windows, you can use the clang-cl toolset and open the project in Visual Stud

## Special Thanks

This project could not have been possible without the [Xenia](https://github.com/xenia-project/xenia) emulator, as many parts of the CPU code conversion process has been implemented by heavily referencing its PPC code translator. The project also uses code from [Xenia Canary](https://github.com/xenia-canary/xenia-canary) to patch XEX binaries.
This project could not have been possible without the [Xenia](https://github.com/xenia-project/xenia) emulator, as many parts of the CPU code conversion process has been implemented by heavily referencing its PPC code translator. The project also uses code from [Xenia Canary](https://github.com/xenia-canary/xenia-canary) to patch XEX binaries.