From 00017abd0cbc8035e97b5e65981fcc32e27fdb0f Mon Sep 17 00:00:00 2001 From: esnya <2088693+esnya@users.noreply.github.com> Date: Wed, 22 Apr 2026 02:00:37 +0900 Subject: [PATCH 1/5] ci(workflows): :construction_worker: align CI with .NET 10 build --- .github/workflows/ci.yml | 139 +++++------------- src/WhileLoopTimeout/WhileLoopTimeout.csproj | 2 +- .../WhileLoopTimeout.Tests.csproj | 2 +- 3 files changed, 37 insertions(+), 106 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0974c79..00ace76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,149 +1,80 @@ -name: CI +name: ci + +permissions: + contents: write on: + pull_request: push: branches: + - main - master tags: - - v* - pull_request: - workflow_dispatch: - -permissions: - contents: read + - "v*" env: - DOTNET_NOLOGO: true - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: true - RESONITE_INSTALL_DIR: ${{ github.workspace }}/.resonite + RESONITE_INSTALL_DIR: ${{ github.workspace }}/Resonite jobs: build: runs-on: ubuntu-latest - timeout-minutes: 30 + steps: - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 - - name: Verify Steam credentials - shell: bash - run: | - if [ -z "${{ secrets.STEAMUSER }}" ]; then - echo '::error::Missing secrets.STEAMUSER. Add the Steam username used for SteamCMD downloads.' - exit 1 - fi - if [ -z "${{ secrets.STEAMPASS }}" ]; then - echo '::error::Missing secrets.STEAMPASS. Add the Steam password used for SteamCMD downloads.' - exit 1 - fi + - name: Setup .NET 10 + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 10.0.x - name: Setup Resonite environment - id: resonite uses: resonite-modding-group/setup-resonite-env-action@v0.1.0 with: steam-user: ${{ secrets.STEAMUSER }} steam-password: ${{ secrets.STEAMPASS }} resonite-path: ${{ env.RESONITE_INSTALL_DIR }} - - name: Install ResoniteModLoader binaries - env: - RESONITE_PATH: ${{ env.RESONITE_INSTALL_DIR }} + - name: Prepare fallback references 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" \ + mkdir -p "${RESONITE_INSTALL_DIR}/Libraries" "${RESONITE_INSTALL_DIR}/rml_libs" + curl -fsSL -o "${RESONITE_INSTALL_DIR}/Libraries/ResoniteModLoader.dll" \ https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/ResoniteModLoader.dll - curl -sSfL -o "$RESONITE_PATH/rml_libs/0Harmony.dll" \ + curl -fsSL -o "${RESONITE_INSTALL_DIR}/rml_libs/0Harmony.dll" \ https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/0Harmony.dll - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 9.0.x - - - name: Cache NuGet packages - uses: actions/cache@v4 - with: - path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json', '**/*.csproj') }} - restore-keys: | - ${{ runner.os }}-nuget- - - name: Restore - env: - ResoniteAssembliesDir: ${{ env.RESONITE_INSTALL_DIR }} - shell: bash - run: | - dotnet restore WhileLoopTimeout.sln + run: dotnet restore ./WhileLoopTimeout.sln -p:ResoniteAssembliesDir="${{ env.RESONITE_INSTALL_DIR }}/" - - name: Verify formatting - env: - ResoniteAssembliesDir: ${{ env.RESONITE_INSTALL_DIR }} - shell: bash - run: | - dotnet format WhileLoopTimeout.sln --verify-no-changes --no-restore + - name: Format + run: dotnet format ./WhileLoopTimeout.sln --verify-no-changes --no-restore -p:ResoniteAssembliesDir="${{ env.RESONITE_INSTALL_DIR }}/" - name: Build - env: - ResoniteAssembliesDir: ${{ env.RESONITE_INSTALL_DIR }} - shell: bash - run: | - dotnet build WhileLoopTimeout.sln --configuration Release --no-restore + run: dotnet build ./WhileLoopTimeout.sln -c Release --no-restore -p:ResoniteAssembliesDir="${{ env.RESONITE_INSTALL_DIR }}/" - name: Test - env: - ResoniteAssembliesDir: ${{ env.RESONITE_INSTALL_DIR }} - shell: bash - run: | - dotnet test WhileLoopTimeout.sln --configuration Release --no-build + run: dotnet test ./WhileLoopTimeout.sln -c Release --no-build -p:ResoniteAssembliesDir="${{ env.RESONITE_INSTALL_DIR }}/" - - name: Prepare release assets + - name: Pack artifact if: startsWith(github.ref, 'refs/tags/v') shell: bash run: | 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" - fi + mkdir -p artifacts + cp ./src/WhileLoopTimeout/bin/Release/net10.0/WhileLoopTimeout.dll ./artifacts/ - - name: Upload release artifacts + - name: Upload artifact if: startsWith(github.ref, 'refs/tags/v') - uses: actions/upload-artifact@v4 - with: - name: while-loop-timeout - path: release-artifacts - if-no-files-found: error - - release: - runs-on: ubuntu-latest - needs: build - if: startsWith(github.ref, 'refs/tags/v') - permissions: - contents: write - steps: - - name: Download build artifacts - uses: actions/download-artifact@v4 + uses: actions/upload-artifact@v7 with: - name: while-loop-timeout - path: release-artifacts + name: WhileLoopTimeout + path: artifacts/WhileLoopTimeout.dll - - name: Publish GitHub release - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{ github.ref_name }} - name: While Loop Timeout ${{ github.ref_name }} - generate_release_notes: true - files: | - release-artifacts/WhileLoopTimeout.dll - release-artifacts/WhileLoopTimeout.pdb + - name: Create GitHub Release + if: startsWith(github.ref, 'refs/tags/v') + env: + GITHUB_TOKEN: ${{ github.token }} + run: gh release create "${{ github.ref_name }}" ./artifacts/WhileLoopTimeout.dll --verify-tag --generate-notes diff --git a/src/WhileLoopTimeout/WhileLoopTimeout.csproj b/src/WhileLoopTimeout/WhileLoopTimeout.csproj index d292b1d..c10e086 100644 --- a/src/WhileLoopTimeout/WhileLoopTimeout.csproj +++ b/src/WhileLoopTimeout/WhileLoopTimeout.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 enable enable 12.0 diff --git a/tests/WhileLoopTimeout.Tests/WhileLoopTimeout.Tests.csproj b/tests/WhileLoopTimeout.Tests/WhileLoopTimeout.Tests.csproj index 658df3c..a2f0a33 100644 --- a/tests/WhileLoopTimeout.Tests/WhileLoopTimeout.Tests.csproj +++ b/tests/WhileLoopTimeout.Tests/WhileLoopTimeout.Tests.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 enable enable WhileLoopTimeout.Tests From 0e76f600883b8880c32f4366605a9103dd0ea32e Mon Sep 17 00:00:00 2001 From: esnya <2088693+esnya@users.noreply.github.com> Date: Wed, 22 Apr 2026 02:15:46 +0900 Subject: [PATCH 2/5] chore(ci): :repeat: retrigger PR checks From 387f266a47ffa36d93e377283701bfacb5400218 Mon Sep 17 00:00:00 2001 From: esnya <2088693+esnya@users.noreply.github.com> Date: Wed, 22 Apr 2026 02:44:00 +0900 Subject: [PATCH 3/5] fix(ci): :bug: run PR checks without Steam secrets --- .github/workflows/ci.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70ef7fc..b85aa4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,25 @@ env: RESONITE_INSTALL_DIR: ${{ github.workspace }}/.resonite jobs: + formatting: + runs-on: ubuntu-latest + 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: 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: @@ -80,12 +98,6 @@ jobs: 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 - - name: Build env: ResoniteAssembliesDir: ${{ env.RESONITE_INSTALL_DIR }} From c090f3e8ac20bebd429d7d7fc2cd5f39be25bf3b Mon Sep 17 00:00:00 2001 From: esnya <2088693+esnya@users.noreply.github.com> Date: Wed, 22 Apr 2026 02:54:22 +0900 Subject: [PATCH 4/5] fix(ci): :bug: restore PR build path --- .github/workflows/ci.yml | 31 ++++++++++++++++++- Directory.Build.props | 5 +++ Directory.Build.targets | 3 +- src/WhileLoopTimeout/WhileLoopTimeout.csproj | 14 ++++++++- .../WhileLoopTimeout.Tests.csproj | 15 ++++++++- 5 files changed, 64 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b85aa4b..35e0ac7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,8 @@ env: jobs: formatting: runs-on: ubuntu-latest + env: + ResoniteAssembliesDir: ${{ github.workspace }}/.resonite steps: - name: Checkout uses: actions/checkout@v4 @@ -34,11 +36,20 @@ jobs: 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 @@ -49,6 +60,7 @@ jobs: fetch-depth: 0 - name: Verify Steam credentials + if: github.event_name != 'pull_request' shell: bash run: | if [ -z "${{ secrets.STEAMUSER }}" ]; then @@ -61,12 +73,29 @@ jobs: fi - name: Setup Resonite environment + if: github.event_name != 'pull_request' uses: resonite-modding-group/setup-resonite-env-action@v0.1.0 with: steam-user: ${{ secrets.STEAMUSER }} steam-password: ${{ secrets.STEAMPASS }} resonite-path: ${{ env.RESONITE_INSTALL_DIR }} + - name: Setup SteamCMD + if: github.event_name == 'pull_request' + uses: CyberAndrii/setup-steamcmd@29e114af032a947f5ed57832409070d6e4cbfce3 + + - name: Download Resonite with anonymous SteamCMD + if: github.event_name == 'pull_request' + shell: bash + run: | + set -euo pipefail + steamcmd \ + '+@sSteamCmdForcePlatformType windows' \ + '+force_install_dir "${RESONITE_INSTALL_DIR}"' \ + '+login anonymous' \ + '+app_update 2519830 validate' \ + '+quit' + - name: Install ResoniteModLoader binaries env: RESONITE_PATH: ${{ env.RESONITE_INSTALL_DIR }} 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 c10e086..2d74b4f 100644 --- a/src/WhileLoopTimeout/WhileLoopTimeout.csproj +++ b/src/WhileLoopTimeout/WhileLoopTimeout.csproj @@ -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 a2f0a33..34127f0 100644 --- a/tests/WhileLoopTimeout.Tests/WhileLoopTimeout.Tests.csproj +++ b/tests/WhileLoopTimeout.Tests/WhileLoopTimeout.Tests.csproj @@ -6,6 +6,7 @@ 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 + + + From 38bca8045ff8ae03c3afdea58932be48f247e4e3 Mon Sep 17 00:00:00 2001 From: esnya <2088693+esnya@users.noreply.github.com> Date: Wed, 22 Apr 2026 03:00:24 +0900 Subject: [PATCH 5/5] fix(ci): :bug: scope PR checks to formatting --- .github/workflows/ci.yml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35e0ac7..615fc69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,7 @@ jobs: run: dotnet format WhileLoopTimeout.sln --verify-no-changes build: + if: github.event_name != 'pull_request' needs: formatting runs-on: ubuntu-latest timeout-minutes: 30 @@ -60,7 +61,6 @@ jobs: fetch-depth: 0 - name: Verify Steam credentials - if: github.event_name != 'pull_request' shell: bash run: | if [ -z "${{ secrets.STEAMUSER }}" ]; then @@ -73,29 +73,12 @@ jobs: fi - name: Setup Resonite environment - if: github.event_name != 'pull_request' uses: resonite-modding-group/setup-resonite-env-action@v0.1.0 with: steam-user: ${{ secrets.STEAMUSER }} steam-password: ${{ secrets.STEAMPASS }} resonite-path: ${{ env.RESONITE_INSTALL_DIR }} - - name: Setup SteamCMD - if: github.event_name == 'pull_request' - uses: CyberAndrii/setup-steamcmd@29e114af032a947f5ed57832409070d6e4cbfce3 - - - name: Download Resonite with anonymous SteamCMD - if: github.event_name == 'pull_request' - shell: bash - run: | - set -euo pipefail - steamcmd \ - '+@sSteamCmdForcePlatformType windows' \ - '+force_install_dir "${RESONITE_INSTALL_DIR}"' \ - '+login anonymous' \ - '+app_update 2519830 validate' \ - '+quit' - - name: Install ResoniteModLoader binaries env: RESONITE_PATH: ${{ env.RESONITE_INSTALL_DIR }}