Skip to content

fixed working directory when downloading Resonite #151

fixed working directory when downloading Resonite

fixed working directory when downloading Resonite #151

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 (MonkeyLoader)
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.MonkeyLoader"
PROJECT_FILE: "SampleModMonkey.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/MonkeyLoader/Release"
TEST_PROJECT_FILE: "Test/Test.csproj"
MOD_LOADER_TEST_PROJECT_FILE: "TestMonkey/TestMonkey.csproj"
RESONITE_CLONE_REPO: "${{ github.repository_owner }}/ResoniteFiles"
defaults:
run:
working-directory: "./repo"
jobs:
build-MonkeyLoader:
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 MonkeyLoader
uses: robinraju/release-downloader@efa4cd07bd0195e6cc65e9e30c251b49ce4d3e51
with:
repository: Banane9/MonkeyLoader
tag: v0.1.0-alpha
fileName: "MonkeyLoader*.zip"
out-file-path: MonkeyLoader/
- name: Move MonkeyLoader files
run: |
mkdir -p "$PROJECT_PATH/MonkeyLoader GamePacks"
mkdir -p "$PROJECT_PATH/MonkeyLoader Mods"
mkdir -p "$ResonitePath/MonkeyLoader/GamePacks"
mkdir -p "$ResonitePath/MonkeyLoader/Mods"
unzip -o "${{ github.workspace }}/MonkeyLoader/MonkeyLoader*.zip" -d "$ResonitePath"
- 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 }}"
- name: Upload build artifacts
if: ${{ inputs.RELEASE_VERSION }}
uses: actions/[email protected]
with:
name: "${{ env.ARTIFACT_NAME }}-MonkeyLoader"
path: "${{ env.PROJECT_PATH }}/${{ env.OUTPUT_FOLDER }}/${{ env.ASSEMBLY_NAME }}.${{ inputs.RELEASE_VERSION }}.nupkg"