Skip to content

Commit

Permalink
Merge pull request #599 from RinLovesYou/alpha-development
Browse files Browse the repository at this point in the history
New proxy doesn't need linker flags (Thank you Github CI)
  • Loading branch information
RinLovesYou authored Jan 4, 2024
2 parents 9ef8631 + 9713096 commit c837ad6
Show file tree
Hide file tree
Showing 26 changed files with 1,963 additions and 3,101 deletions.
196 changes: 100 additions & 96 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,148 +8,152 @@ on:
workflow_dispatch:

jobs:
build_core_debug:
build_melonloader:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: setup-msbuild
- name: Setup MsBuild
uses: microsoft/setup-msbuild@v1
- name: Build Melonloader Core
- name: Build Melonloader (Release)
shell: cmd
run: msbuild /restore /p:Platform="Windows - x64" # Platform is actually irrelevant for core, it's compiled as AnyCPU either way
- name: Upload core artifact
run: msbuild /restore /p:Configuration=Release /p:Platform="Windows - x64"
- name: Build MelonLoader (Debug)
shell: cmd
run: msbuild /restore /p:Platform="Windows - x64"
- name: Upload Release Artifact
uses: actions/upload-artifact@v3
with:
name: MLCoreRelease
path: Output/Release/MelonLoader/
- name: Upload Debug Artifact
uses: actions/upload-artifact@v3
with:
name: MLCoreDebug
path: Output/Debug/MelonLoader/
build_core_release:
runs-on: windows-latest
build_rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1
- name: Build Melonloader Core
shell: cmd
run: msbuild /restore /p:Configuration=Release /p:Platform="Windows - x64"
- name: Upload core artifact
- name: Install Rust (nightly)
run:
curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Make Rust Nightly
shell: bash
run: rustup default nightly
- name: Install Linux target x64
shell: bash
run: rustup target add x86_64-unknown-linux-gnu
- name: Install Windows target x64
shell: bash
run: rustup target add x86_64-pc-windows-gnu
- name: Install Windows target x86
shell: bash
run: rustup target add i686-pc-windows-gnu
- name: Install Windows target x64 (MSVC)
shell: bash
run: rustup target add x86_64-pc-windows-msvc
- name: Install Windows target x86 (MSVC)
shell: bash
run: rustup target add i686-pc-windows-msvc
- name: Install x-win
shell: bash
run: cargo install cargo-xwin
- name: install dev dependencies
shell: bash
run: sudo apt-get install libgtk-3-dev mingw-w64 binutils-mingw-w64 wine llvm
- name: Build Rust Release | Linux - x64
shell: bash
run: cargo build --target x86_64-unknown-linux-gnu --release
- name: Build Rust Debug | Linux - x64
shell: bash
run: cargo build --target x86_64-unknown-linux-gnu
- name: Build Bootstrap Release | Windows - x64
shell: bash
run: cargo xwin build --package Bootstrap --target x86_64-pc-windows-msvc --release
- name: Build Bootstrap Debug | Windows - x64
shell: bash
run: cargo xwin build --package Bootstrap --target x86_64-pc-windows-msvc
- name: Build Bootstrap Release | Windows - x86
shell: bash
run: XWIN_ARCH=x86 cargo xwin build --package Bootstrap --target i686-pc-windows-msvc --release
- name: Build Bootstrap Debug | Windows - x86
shell: bash
run: XWIN_ARCH=x86 cargo xwin build --package Bootstrap --target i686-pc-windows-msvc
- name: Build Proxy Release | Windows - x64
shell: bash
run: cargo build --package MelonProxy --target x86_64-pc-windows-gnu --release
- name: Build Proxy Debug | Windows - x64
shell: bash
run: cargo build --package MelonProxy --target x86_64-pc-windows-gnu
- name: Build Proxy Release | Windows - x86
shell: bash
run: cargo build --package MelonProxy --target i686-pc-windows-gnu --release
- name: Build Proxy Debug | Windows - x86
shell: bash
run: cargo build --package MelonProxy --target i686-pc-windows-gnu
- name: Upload Proxy Release | Linux x64
uses: actions/upload-artifact@v3
with:
name: MLCoreRelease
path: Output/Release/MelonLoader/
build_rust_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: rust-toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
# Target triple to install for this toolchain
targets: i686-pc-windows-msvc, x86_64-pc-windows-msvc
# Build Rust Release
- name: Build Rust Release | Windows - x86
shell: cmd
run: cargo +nightly build --target i686-pc-windows-msvc --release
- name: Build Rust Release | Windows - x64
shell: cmd
run: cargo +nightly build --target x86_64-pc-windows-msvc --release
# Build Rust Debug
- name: Build Rust Debug | Windows - x86
shell: cmd
run: cargo +nightly build --target i686-pc-windows-msvc
- name: Build Rust Debug | Windows - x64
shell: cmd
run: cargo +nightly build --target x86_64-pc-windows-msvc
# Upload Proxy Release - x86
name: MLProxyX64-Linux-Release
path: target/x86_64-unknown-linux-gnu/release/libversion.so
- name: Upload Bootstrap Release | Linux x64
uses: actions/upload-artifact@v3
with:
name: MLBootstrapX64-Linux-Release
path: target/x86_64-unknown-linux-gnu/release/libBootstrap.so
- name: Upload Proxy Debug | Linux x64
uses: actions/upload-artifact@v3
with:
name: MLProxyX64-Linux-Debug
path: target/x86_64-unknown-linux-gnu/debug/libversion.so
- name: Upload Bootstrap Debug | Linux x64
uses: actions/upload-artifact@v3
with:
name: MLBootstrapX64-Linux-Debug
path: target/x86_64-unknown-linux-gnu/debug/libBootstrap.so
- name: Upload Proxy Release | Windows x86
uses: actions/upload-artifact@v3
with:
name: MLProxyX86-Windows-Release
path: target/i686-pc-windows-msvc/release/version.dll
# Upload Bootstrap Release - x86
path: target/i686-pc-windows-gnu/release/version.dll
- name: Upload Bootstrap Release | Windows x86
uses: actions/upload-artifact@v3
with:
name: MLBootstrapX86-Windows-Release
path: target/i686-pc-windows-msvc/release/Bootstrap.dll
# Upload Proxy Release - x64
- name: Upload Proxy Release | Windows x64
uses: actions/upload-artifact@v3
with:
name: MLProxyX64-Windows-Release
path: target/x86_64-pc-windows-msvc/release/version.dll
# Upload Bootstrap Release - x64
path: target/x86_64-pc-windows-gnu/release/version.dll
- name: Upload Bootstrap Release | Windows x64
uses: actions/upload-artifact@v3
with:
name: MLBootstrapX64-Windows-Release
path: target/x86_64-pc-windows-msvc/release/Bootstrap.dll
# Upload Proxy Debug - x86
- name: Upload Proxy Debug | Windows x86
uses: actions/upload-artifact@v3
with:
name: MLProxyX86-Windows-Debug
path: target/i686-pc-windows-msvc/debug/version.dll
# Upload Bootstrap Debug - x86
path: target/i686-pc-windows-gnu/debug/version.dll
- name: Upload Bootstrap Debug | Windows x86
uses: actions/upload-artifact@v3
with:
name: MLBootstrapX86-Windows-Debug
path: target/i686-pc-windows-msvc/debug/Bootstrap.dll
# Upload Proxy Debug - x64
- name: Upload Proxy Debug | Windows x64
uses: actions/upload-artifact@v3
with:
name: MLProxyX64-Windows-Debug
path: target/x86_64-pc-windows-msvc/debug/version.dll
# Upload Bootstrap Debug - x64
path: target/x86_64-pc-windows-gnu/debug/version.dll
- name: Upload Bootstrap Debug | Windows x64
uses: actions/upload-artifact@v3
with:
name: MLBootstrapX64-Windows-Debug
path: target/x86_64-pc-windows-msvc/debug/Bootstrap.dll
build_rust_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: rust-toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
# Target triple to install for this toolchain
targets: x86_64-unknown-linux-gnu
- name: install dev dependencies
shell: bash
run: sudo apt-get install libgtk-3-dev
- name: Build Rust Release | Linux - x64
shell: bash
run: cargo +nightly build --target x86_64-unknown-linux-gnu --release
- name: Build Rust Debug | Linux - x64
shell: bash
run: cargo +nightly build --target x86_64-unknown-linux-gnu
- name: Upload Proxy Release | Linux x64
uses: actions/upload-artifact@v3
with:
name: MLProxyX64-Linux-Release
path: target/x86_64-unknown-linux-gnu/release/libversion.so
- name: Upload Bootstrap Release | Linux x64
uses: actions/upload-artifact@v3
with:
name: MLBootstrapX64-Linux-Release
path: target/x86_64-unknown-linux-gnu/release/libBootstrap.so
- name: Upload Proxy Debug | Linux x64
uses: actions/upload-artifact@v3
with:
name: MLProxyX64-Linux-Debug
path: target/x86_64-unknown-linux-gnu/debug/libversion.so
- name: Upload Bootstrap Debug | Linux x64
uses: actions/upload-artifact@v3
with:
name: MLBootstrapX64-Linux-Debug
path: target/x86_64-unknown-linux-gnu/debug/libBootstrap.so
finalize_x64_debug_zip_windows:
runs-on: windows-latest
needs: [build_core_debug, build_rust_windows]
needs: [build_rust, build_melonloader]
steps:
- uses: actions/checkout@v3
- name: Download core artifact
Expand Down Expand Up @@ -191,7 +195,7 @@ jobs:
path: ./Output/Debug/x64/*
finalize_x86_debug_zip_windows:
runs-on: windows-latest
needs: [build_core_debug, build_rust_windows]
needs: [build_rust, build_melonloader]
steps:
- uses: actions/checkout@v3
- name: Download core artifact
Expand Down Expand Up @@ -233,7 +237,7 @@ jobs:
path: ./Output/Debug/x86/*
finalize_x64_release_zip_windows:
runs-on: windows-latest
needs: [build_core_release, build_rust_windows]
needs: [build_rust, build_melonloader]
steps:
- uses: actions/checkout@v3
- name: Download core artifact
Expand Down Expand Up @@ -275,7 +279,7 @@ jobs:
path: ./Output/Release/x64/*
finalize_x86_release_zip_windows:
runs-on: windows-latest
needs: [build_core_release, build_rust_windows]
needs: [build_rust, build_melonloader]
steps:
- uses: actions/checkout@v3
- name: Download core artifact
Expand Down Expand Up @@ -317,7 +321,7 @@ jobs:
path: ./Output/Release/x86/*
finalize_x64_debug_zip_linux:
runs-on: windows-latest
needs: [build_core_debug, build_rust_linux]
needs: [build_rust, build_melonloader]
steps:
- uses: actions/checkout@v3
- name: Download core artifact
Expand Down Expand Up @@ -356,7 +360,7 @@ jobs:
path: ./Output/Debug/x64/*
finalize_x64_release_zip_linux:
runs-on: windows-latest
needs: [build_core_release, build_rust_linux]
needs: [build_rust, build_melonloader]
steps:
- uses: actions/checkout@v3
- name: Download core artifact
Expand Down
4 changes: 2 additions & 2 deletions Bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
[dependencies]
#unity-rs = { path = "C:/Users/sarah/Documents/rust/Ferrex/unity/" }
unity-rs = { git = "https://github.com/RinLovesYou/Ferrex/", rev = "77d114c" }
ctor = "0.1.26"
ctor = "0.2.6"
chrono = "0.4.23"
colored = "2.0.0"
thiserror = "1.0.39"
Expand All @@ -22,7 +22,7 @@ netcorehost = "0.15.1"
exe = "0.5.6"

[target.'cfg(windows)'.dependencies]
windows = { version = "0.51.0", features = [
windows = { version = "0.52.0", features = [
"Win32_Foundation",
"Win32_System_Console",
"Win32_UI_WindowsAndMessaging"
Expand Down
6 changes: 3 additions & 3 deletions Bootstrap/src/melonenv/paths.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::path::{PathBuf, Path};
use std::path::{PathBuf};

use lazy_static::lazy_static;
use unity_rs::runtime::RuntimeType;

use crate::{errors::DynErr, internal_failure, runtime, constants::W, utils::runtime::{self, NetstandardVersion}};
use crate::{errors::DynErr, internal_failure, runtime, constants::W};


use super::args::ARGS;

lazy_static! {
pub static ref BASE_DIR: W<PathBuf> = {
Expand Down
3 changes: 1 addition & 2 deletions Bootstrap/src/utils/runtime.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use std::{error::Error, collections::HashMap, io, path::Path};

use exe::{ImageDirectoryEntry, ResourceDirectory, VecPE, PE, ImportDirectory, ImportData, CCharString, ImageDataDirectory, ImageResourceDirectory};
use unity_rs::runtime::FerrexRuntime;

use crate::{errors::DynErr, log, melonenv::paths};
use crate::{errors::DynErr, melonenv::paths};

#[allow(dead_code)]
pub static mut RUNTIME: Option<FerrexRuntime> = None;
Expand Down
Loading

0 comments on commit c837ad6

Please sign in to comment.