Skip to content

Bugfix rml

Bugfix rml #143

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Build & Test (ResoniteModLoader)
on:
push:
pull_request:
workflow_call:
inputs:
RELEASE_VERSION:
description: "Release Version"
type: string
required: false
default: ""
RELEASE_NOTES:
description: "Release Notes"
type: string
required: false
default: ""
secrets:
RESONITE_CLONE_TOKEN:
required: true
env:
ARTIFACT_NAME: "SampleMod"
ASSEMBLY_NAME: "mpmxyz.SampleMod.ResoniteModLoader"
PROJECT_FILE: "SampleModRML.csproj"
ResonitePath: "${{ github.workspace }}/Download/Resonite"
PROJECT_URL: "${{ github.server_url }}/${{ github.repository }}"
PROJECT_PATH: "${{ github.workspace }}/repo"
RELEASE_NOTES: "${{ inputs.RELEASE_NOTES }}"
RELEASE_VERSION: "${{ inputs.RELEASE_VERSION }}"
OUTPUT_FOLDER: "bin/RML/Release/net472"
TEST_PROJECT_FILE: "Test/Test.csproj"
MOD_LOADER_TEST_PROJECT_FILE: "TestRML/TestRML.csproj"
RESONITE_CLONE_REPO: "${{ github.repository_owner }}/ResoniteFiles"
defaults:
run:
working-directory: "./repo"
jobs:
build-ResoniteModLoader:
runs-on: ubuntu-latest
steps:
- name: Fetch repository
uses: actions/checkout@v4
with:
path: ${{ env.PROJECT_PATH }}
- name: Fetch latest Resonite
uses: actions/checkout@v4
with:
repository: ${{ env.RESONITE_CLONE_REPO }}
token: ${{ secrets.RESONITE_CLONE_TOKEN }}
path: ${{ env.ResonitePath }}/..
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Fetch latest ResoniteModLoader
uses: robinraju/release-downloader@efa4cd07bd0195e6cc65e9e30c251b49ce4d3e51
with:
repository: resonite-modding-group/ResoniteModLoader
latest: true
fileName: "*.dll"
out-file-path: RML/
- name: Move ResoniteModLoader files
run: |
mkdir -p "$ResonitePath/rml_mods"
mkdir -p "$ResonitePath/rml_libs"
mkdir -p "$ResonitePath/Libraries"
mv ${{ github.workspace }}/RML/0Harmony.dll "$ResonitePath/rml_libs/0Harmony.dll"
mv ${{ github.workspace }}/RML/ResoniteModLoader.dll "$ResonitePath/Libraries/ResoniteModLoader.dll"
- name: Restore dependencies
run: |
dotnet restore "${{ env.PROJECT_FILE }}"
dotnet restore "${{ env.TEST_PROJECT_FILE }}"
dotnet restore "${{ env.MOD_LOADER_TEST_PROJECT_FILE }}"
env:
ASSEMBLY_NAME: ""
- name: Check formatting
run: |
dotnet format --no-restore --verify-no-changes "${{ env.PROJECT_FILE }}"
dotnet format --no-restore --verify-no-changes "${{ env.TEST_PROJECT_FILE }}"
dotnet format --no-restore --verify-no-changes "${{ env.MOD_LOADER_TEST_PROJECT_FILE }}"
env:
ASSEMBLY_NAME: ""
- name: Test
run: |
dotnet test --no-restore --configuration "Release" "${{ env.TEST_PROJECT_FILE }}"
dotnet test --no-restore --configuration "Release" "${{ env.MOD_LOADER_TEST_PROJECT_FILE }}"
env:
ASSEMBLY_NAME: ""
- name: Build
run: |
dotnet build --no-restore --configuration "Release" "${{ env.PROJECT_FILE }}"
cd "${{ env.OUTPUT_FOLDER }}"
mkdir -p "archive/rml_mods"
cp "${{ env.ASSEMBLY_NAME }}.dll" "archive/rml_mods/${{ env.ASSEMBLY_NAME }}.dll"
#mkdir -p "archive/rml_libs"
#cp LIB.dll "archive/rml_libs/LIB.dll"
cd archive
zip -r "${{ env.ARTIFACT_NAME }}-ResoniteModLoader.zip" .
- name: Upload build artifacts
if: ${{ inputs.RELEASE_VERSION }}
uses: actions/upload-artifact@v3.1.3
with:
name: "${{ env.ARTIFACT_NAME }}-ResoniteModLoader"
path: "${{ env.PROJECT_PATH }}/${{ env.OUTPUT_FOLDER }}/archive"