This repository was archived by the owner on Sep 16, 2025. It is now read-only.
Release #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| workflow_dispatch: | |
| inputs: | |
| create_release: | |
| description: 'Create a GitHub release' | |
| required: false | |
| default: 'true' | |
| type: choice | |
| options: | |
| - 'true' | |
| - 'false' | |
| jobs: | |
| build-bepinex: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout BepInEx | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ResoniteModding/BepInEx | |
| ref: master | |
| submodules: recursive | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "9.0.x" | |
| - name: Build BepInEx | |
| run: | | |
| chmod +x build.sh | |
| ./build.sh | |
| echo "BepInEx build completed" | |
| ls -la bin/NET.CoreCLR/net9.0/ | |
| - name: Upload BepInEx artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bepinex-build | |
| path: bin/NET.CoreCLR/net9.0/ | |
| build-bepisloader: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "9.0.x" | |
| - name: Build BepisLoader | |
| run: | | |
| dotnet build -c Release | |
| echo "BepisLoader build completed" | |
| ls -la bin/Release/net9.0/ | |
| - name: Upload BepisLoader artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bepisloader-build | |
| path: bin/Release/net9.0/ | |
| download-resoniteshim: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "9.0.x" | |
| - name: Download ResoniteShim from NuGet | |
| run: | | |
| # Query the NuGet API for the latest version | |
| PACKAGE_ID="ResoniteModding.BepInExResoniteShim" | |
| INDEX_URL="https://nuget-modding.resonite.net/v3/index.json" | |
| # Get the service index | |
| SERVICE_INDEX=$(curl -s $INDEX_URL) | |
| # Get the package metadata URL | |
| PACKAGE_BASE=$(echo $SERVICE_INDEX | jq -r '.resources[] | select(."@type" | contains("PackageBaseAddress")) | ."@id"') | |
| # Get registration URL for version discovery | |
| REGISTRATION_BASE=$(echo $SERVICE_INDEX | jq -r '.resources[] | select(."@type" | contains("RegistrationsBaseUrl")) | ."@id"') | |
| # Get the latest version | |
| VERSIONS_URL="${REGISTRATION_BASE}${PACKAGE_ID,,}/index.json" | |
| LATEST_VERSION=$(curl -s $VERSIONS_URL | jq -r '.items[0].items | last | .catalogEntry.version') | |
| echo "Latest version: $LATEST_VERSION" | |
| # Download the nupkg file | |
| DOWNLOAD_URL="${PACKAGE_BASE}${PACKAGE_ID,,}/${LATEST_VERSION}/${PACKAGE_ID,,}.${LATEST_VERSION}.nupkg" | |
| wget -q -O package.nupkg "$DOWNLOAD_URL" | |
| # Extract the DLL from the nupkg (which is just a zip file) | |
| unzip -q package.nupkg | |
| # Find and move the DLL | |
| find . -name "BepInExResoniteShim.dll" -exec cp {} . \; | |
| echo "ResoniteShim DLL downloaded successfully" | |
| ls -la BepInExResoniteShim.dll | |
| - name: Upload ResoniteShim artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: resoniteshim-build | |
| path: BepInExResoniteShim.dll | |
| release: | |
| needs: [build-bepinex, build-bepisloader, download-resoniteshim] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Collect build info | |
| id: info | |
| run: | | |
| SHA_SHORT=$(git rev-parse --short HEAD) | |
| echo "sha_short=$SHA_SHORT" >> $GITHUB_OUTPUT | |
| VERSION=$(grep -oP '(?<=<Version>)[^<]+' BepisLoader.csproj) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version found: $VERSION" | |
| - name: Download BepInEx artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: bepinex-build | |
| path: bepinex-artifacts | |
| - name: Download BepisLoader artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: bepisloader-build | |
| path: bepisloader-artifacts | |
| - name: Download ResoniteShim artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: resoniteshim-build | |
| path: resoniteshim-artifacts | |
| - name: Prepare common release files | |
| run: | | |
| # Create directory structure for both platforms | |
| for platform in linux windows; do | |
| mkdir -p release/$platform | |
| mkdir -p release/$platform/BepInEx/core | |
| mkdir -p release/$platform/BepInEx/patchers | |
| mkdir -p release/$platform/BepInEx/plugins | |
| # Copy BepisLoader files | |
| cp bepisloader-artifacts/BepisLoader.dll release/$platform/ | |
| cp bepisloader-artifacts/BepisLoader.pdb release/$platform/ | |
| cp bepisloader-artifacts/BepisLoader.deps.json release/$platform/ | |
| # Copy BepInEx core files | |
| cp bepinex-artifacts/*.dll release/$platform/BepInEx/core/ || true | |
| cp bepinex-artifacts/*.pdb release/$platform/BepInEx/core/ || true | |
| cp bepinex-artifacts/*.xml release/$platform/BepInEx/core/ || true | |
| cp bepinex-artifacts/*.json release/$platform/BepInEx/core/ || true | |
| # Copy ResoniteShim to plugins | |
| cp resoniteshim-artifacts/BepInExResoniteShim.dll release/$platform/BepInEx/plugins/ | |
| done | |
| echo "Common files prepared for both platforms" | |
| - name: Configure Linux release | |
| run: | | |
| # Create Linux-specific runtimeconfig.json | |
| cat > release/linux/BepisLoader.runtimeconfig.json << 'EOF' | |
| { | |
| "runtimeOptions": { | |
| "tfm": "net9.0", | |
| "frameworks": [ | |
| { | |
| "name": "Microsoft.NETCore.App", | |
| "version": "9.0.0" | |
| } | |
| ], | |
| "configProperties": { | |
| "System.Reflection.Metadata.MetadataUpdater.IsSupported": false, | |
| "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false | |
| } | |
| } | |
| } | |
| EOF | |
| # Create Linux zip | |
| cd release/linux | |
| zip -r ../BepisLoader-full-linux.zip . | |
| cd ../.. | |
| echo "Linux release created" | |
| - name: Configure Windows release | |
| run: | | |
| # Create Windows-specific runtimeconfig.json with WindowsDesktop.App | |
| cat > release/windows/BepisLoader.runtimeconfig.json << 'EOF' | |
| { | |
| "runtimeOptions": { | |
| "tfm": "net9.0", | |
| "frameworks": [ | |
| { | |
| "name": "Microsoft.NETCore.App", | |
| "version": "9.0.0" | |
| }, | |
| { | |
| "name": "Microsoft.WindowsDesktop.App", | |
| "version": "9.0.0" | |
| } | |
| ], | |
| "configProperties": { | |
| "System.Reflection.Metadata.MetadataUpdater.IsSupported": false, | |
| "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false | |
| } | |
| } | |
| } | |
| EOF | |
| # Add hookfxr files from lib/hostfxr directory | |
| cp lib/hostfxr/hostfxr.dll release/windows/ | |
| cp lib/hostfxr/hostfxr.pdb release/windows/ | |
| cp lib/hostfxr/hookfxr.ini release/windows/ | |
| # Create Windows zip | |
| cd release/windows | |
| zip -r ../BepisLoader-full-windows.zip . | |
| cd ../.. | |
| echo "Windows release created" | |
| - name: Check if release exists | |
| id: check_release | |
| run: | | |
| TAG_NAME="${{ steps.info.outputs.version }}" | |
| # Check if a release exists for this tag | |
| if gh release view "$TAG_NAME" >/dev/null 2>&1; then | |
| echo "Release $TAG_NAME already exists" | |
| echo "release_exists=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "Release $TAG_NAME does not exist" | |
| echo "release_exists=false" >> $GITHUB_OUTPUT | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Git Tag | |
| if: ${{ github.event_name == 'workflow_dispatch' }} | |
| run: | | |
| TAG_NAME="${{ steps.info.outputs.version }}" | |
| if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then | |
| echo "Tag $TAG_NAME already exists" | |
| else | |
| echo "Creating tag $TAG_NAME" | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| git tag -a "$TAG_NAME" -m "Release $TAG_NAME" | |
| git push origin "$TAG_NAME" | |
| fi | |
| - name: Create GitHub Release | |
| if: ${{ ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.create_release == 'true')) && steps.check_release.outputs.release_exists != 'true' }} | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| prerelease: false | |
| generate_release_notes: true | |
| fail_on_unmatched_files: true | |
| name: ${{ steps.info.outputs.version }} | |
| tag_name: ${{ steps.info.outputs.version }} | |
| target_commitish: ${{ github.sha }} | |
| append_body: | | |
| ### Windows Installation | |
| 1. Extract the zip over your Resonite folder | |
| 2. Launch Resonite.exe | |
| ### Linux Installation | |
| 1. Extract the zip over your Resonite folder | |
| 2. Change LinuxBootstrap.sh to launch `BepisLoader.dll` instead of `Renderite.Host.dll` | |
| (This needs to be re-done every time Resonite updates) | |
| 3. Launch Resonite | |
| files: | | |
| release/BepisLoader-full-windows.zip | |
| release/BepisLoader-full-linux.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload release artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-packages | |
| path: | | |
| release/BepisLoader-full-windows.zip | |
| release/BepisLoader-full-linux.zip |