|
| 1 | +name: Build YARG-VR |
| 2 | + |
| 3 | +# Builds the MelonLoader mod against the real YARG + MelonLoader + Unity reference |
| 4 | +# assemblies and publishes a ready-to-install artifact (mod DLL + openvr_api.dll). |
| 5 | +# Tagged pushes additionally attach the artifact to a GitHub Release. |
| 6 | + |
| 7 | +on: |
| 8 | + push: |
| 9 | + branches: [main, master] |
| 10 | + tags: ['v*'] |
| 11 | + pull_request: |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +env: |
| 15 | + YARG_VERSION: '0.15.0' # reference game version (keep in sync with RESEARCH.md) |
| 16 | + |
| 17 | +jobs: |
| 18 | + build: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v4 |
| 23 | + |
| 24 | + - name: Setup .NET SDK 8 |
| 25 | + uses: actions/setup-dotnet@v4 |
| 26 | + with: |
| 27 | + dotnet-version: 8.0.x |
| 28 | + |
| 29 | + - name: Download MelonLoader (latest x64) |
| 30 | + run: | |
| 31 | + curl -L --fail -o melonloader.zip \ |
| 32 | + "https://github.com/LavaGang/MelonLoader/releases/latest/download/MelonLoader.x64.zip" |
| 33 | + mkdir -p ml && unzip -q melonloader.zip -d ml |
| 34 | + mkdir -p libs |
| 35 | + cp ml/MelonLoader/net472/MelonLoader.dll libs/ |
| 36 | +
|
| 37 | + - name: Download YARG reference assemblies (YARG_Data/Managed) |
| 38 | + run: | |
| 39 | + curl -L --fail -o yarg.zip \ |
| 40 | + "https://github.com/YARC-Official/YARG/releases/download/v${{ env.YARG_VERSION }}/YARG_v${{ env.YARG_VERSION }}-Windows-x64.zip" |
| 41 | + unzip -q -j -o yarg.zip 'YARG_Data/Managed/*' -d libs/yarg-managed |
| 42 | +
|
| 43 | + - name: Download openvr_api.dll (Valve) |
| 44 | + run: | |
| 45 | + curl -L --fail -o libs/openvr_api.dll \ |
| 46 | + "https://github.com/ValveSoftware/openvr/raw/master/bin/win64/openvr_api.dll" |
| 47 | +
|
| 48 | + - name: Build (net472) |
| 49 | + run: > |
| 50 | + dotnet build YARG.VR.csproj -c Release |
| 51 | + -p:GameLibs="${{ github.workspace }}/libs" |
| 52 | + -p:DOTNET_CLI_TELEMETRY_OPTOUT=1 |
| 53 | +
|
| 54 | + - name: Collect distribution |
| 55 | + run: | |
| 56 | + mkdir -p dist/YARG-VR |
| 57 | + cp bin/Release/YARG-VR.dll dist/YARG-VR/ |
| 58 | + cp libs/openvr_api.dll dist/YARG-VR/ |
| 59 | + { |
| 60 | + echo "YARG-VR v${{ github.ref_name }} (built against YARG v${{ env.YARG_VERSION }})" |
| 61 | + echo "" |
| 62 | + echo "Install:" |
| 63 | + echo " 1. Install MelonLoader (https://melonwiki.xyz/) into your YARG folder." |
| 64 | + echo " 2. Copy BOTH files below into <YARG>/MelonLoader/Mods/YARG-VR/" |
| 65 | + echo " YARG-VR.dll" |
| 66 | + echo " openvr_api.dll" |
| 67 | + echo " 3. Start SteamVR (or let the mod start it), then launch YARG." |
| 68 | + echo " 4. In-game hotkeys: F8 = toggle VR, F9 = recenter." |
| 69 | + echo "" |
| 70 | + } > dist/YARG-VR/INSTALL.txt |
| 71 | + zip -r YARG-VR-${{ github.ref_name }}.zip YARG-VR |
| 72 | +
|
| 73 | + - name: Upload artifact |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: YARG-VR-${{ github.ref_name }} |
| 77 | + path: dist/YARG-VR/ |
| 78 | + if-no-files-found: error |
| 79 | + |
| 80 | + - name: Attach to GitHub Release (tags only) |
| 81 | + if: startsWith(github.ref, 'refs/tags/v') |
| 82 | + uses: softprops/action-gh-release@v2 |
| 83 | + with: |
| 84 | + files: YARG-VR-*.zip |
| 85 | + generate_release_notes: true |
0 commit comments