diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0076136..615fc69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,37 @@ env: RESONITE_INSTALL_DIR: ${{ github.workspace }}/.resonite jobs: + formatting: + runs-on: ubuntu-latest + env: + ResoniteAssembliesDir: ${{ github.workspace }}/.resonite + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 10.0.x + + - name: Prepare fallback references + shell: bash + run: | + set -euo pipefail + mkdir -p "$ResoniteAssembliesDir/Libraries" "$ResoniteAssembliesDir/rml_libs" + curl -sSfL -o "$ResoniteAssembliesDir/Libraries/ResoniteModLoader.dll" \ + https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/ResoniteModLoader.dll + curl -sSfL -o "$ResoniteAssembliesDir/rml_libs/0Harmony.dll" \ + https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/0Harmony.dll + + - name: Verify formatting + run: dotnet format WhileLoopTimeout.sln --verify-no-changes + build: + if: github.event_name != 'pull_request' + needs: formatting runs-on: ubuntu-latest timeout-minutes: 30 steps: @@ -43,7 +73,6 @@ jobs: fi - name: Setup Resonite environment - id: resonite uses: resonite-modding-group/setup-resonite-env-action@v0.1.0 with: steam-user: ${{ secrets.STEAMUSER }} @@ -56,10 +85,6 @@ jobs: shell: bash run: | set -euo pipefail - if [ -z "${RESONITE_PATH:-}" ]; then - echo '::error::Resonite path is empty. Ensure the setup-resonite-env step succeeded and exposed resonite-path.' - exit 1 - fi install -d "$RESONITE_PATH/Libraries" "$RESONITE_PATH/rml_libs" curl -sSfL -o "$RESONITE_PATH/Libraries/ResoniteModLoader.dll" \ https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/ResoniteModLoader.dll @@ -69,7 +94,7 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v4 with: - dotnet-version: 9.0.x + dotnet-version: 10.0.x - name: Cache NuGet packages uses: actions/cache@v4 @@ -83,29 +108,19 @@ jobs: env: ResoniteAssembliesDir: ${{ env.RESONITE_INSTALL_DIR }} shell: bash - run: | - dotnet restore WhileLoopTimeout.sln - - - name: Verify formatting - env: - ResoniteAssembliesDir: ${{ env.RESONITE_INSTALL_DIR }} - shell: bash - run: | - dotnet format WhileLoopTimeout.sln --verify-no-changes --no-restore + run: dotnet restore WhileLoopTimeout.sln - name: Build env: ResoniteAssembliesDir: ${{ env.RESONITE_INSTALL_DIR }} shell: bash - run: | - dotnet build WhileLoopTimeout.sln --configuration Release --no-restore + run: dotnet build WhileLoopTimeout.sln --configuration Release --no-restore - name: Test env: ResoniteAssembliesDir: ${{ env.RESONITE_INSTALL_DIR }} shell: bash - run: | - dotnet test WhileLoopTimeout.sln --configuration Release --no-build + run: dotnet test WhileLoopTimeout.sln --configuration Release --no-build - name: Prepare release assets if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'release' @@ -114,9 +129,9 @@ jobs: set -euo pipefail artifacts_dir=release-artifacts mkdir -p "$artifacts_dir" - cp src/WhileLoopTimeout/bin/Release/net9.0/WhileLoopTimeout.dll "$artifacts_dir/WhileLoopTimeout.dll" - if [ -f src/WhileLoopTimeout/bin/Release/net9.0/WhileLoopTimeout.pdb ]; then - cp src/WhileLoopTimeout/bin/Release/net9.0/WhileLoopTimeout.pdb "$artifacts_dir/WhileLoopTimeout.pdb" + cp src/WhileLoopTimeout/bin/Release/net10.0/WhileLoopTimeout.dll "$artifacts_dir/WhileLoopTimeout.dll" + if [ -f src/WhileLoopTimeout/bin/Release/net10.0/WhileLoopTimeout.pdb ]; then + cp src/WhileLoopTimeout/bin/Release/net10.0/WhileLoopTimeout.pdb "$artifacts_dir/WhileLoopTimeout.pdb" fi - name: Upload release artifacts @@ -158,8 +173,6 @@ jobs: with: tag_name: ${{ steps.tag.outputs.tag_name }} name: While Loop Timeout ${{ steps.tag.outputs.tag_name }} - # When triggered by release event, this updates the existing release - # When triggered by tag push, this creates a new release generate_release_notes: ${{ github.event_name != 'release' }} files: | release-artifacts/WhileLoopTimeout.dll diff --git a/Directory.Build.props b/Directory.Build.props index 9650479..b56d328 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -16,4 +16,9 @@ $([System.IO.Path]::GetFullPath('$(ResoniteAssembliesDir)')) + + + true + false + diff --git a/Directory.Build.targets b/Directory.Build.targets index d378aca..78b3b4f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,6 +1,7 @@ - + + diff --git a/src/WhileLoopTimeout/WhileLoopTimeout.csproj b/src/WhileLoopTimeout/WhileLoopTimeout.csproj index d292b1d..2d74b4f 100644 --- a/src/WhileLoopTimeout/WhileLoopTimeout.csproj +++ b/src/WhileLoopTimeout/WhileLoopTimeout.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 enable enable 12.0 @@ -17,7 +17,7 @@ $(DefineConstants);USE_RESONITE_HOT_RELOAD_LIB - + $(ResolvedResoniteAssembliesDir)/Libraries/ResoniteModLoader.dll false @@ -56,6 +56,18 @@ + + + + $(ResolvedResoniteAssembliesDir)/Libraries/ResoniteModLoader.dll + false + + + $(ResolvedResoniteAssembliesDir)/rml_libs/0Harmony.dll + false + + + diff --git a/tests/WhileLoopTimeout.Tests/WhileLoopTimeout.Tests.csproj b/tests/WhileLoopTimeout.Tests/WhileLoopTimeout.Tests.csproj index 658df3c..34127f0 100644 --- a/tests/WhileLoopTimeout.Tests/WhileLoopTimeout.Tests.csproj +++ b/tests/WhileLoopTimeout.Tests/WhileLoopTimeout.Tests.csproj @@ -1,11 +1,12 @@ - net9.0 + net10.0 enable enable WhileLoopTimeout.Tests false + true $(NoWarn);CA1515;CA1707 @@ -24,7 +25,7 @@ - + $(ResoniteAssembliesDir)/FrooxEngine.dll true @@ -59,4 +60,16 @@ + + + + $(ResoniteAssembliesDir)/Libraries/ResoniteModLoader.dll + true + + + $(ResoniteAssembliesDir)/rml_libs/0Harmony.dll + true + + +