|
| 1 | +name: Build & Upload VRChat World (Windows Self-Hosted) |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + paths-ignore: |
| 9 | + - .github/workflows/build-cache.yml |
| 10 | + - .github/workflows/build-cache-new.yml |
| 11 | + - .github/workflows/cache-unity.yml |
| 12 | + - .github/workspace-scripts/ |
| 13 | + - .github/workflows/vrchat-world-ci.yml |
| 14 | + - .github/workflows/vrchat-world-ci-macos.yml |
| 15 | + release: |
| 16 | + types: [published] |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +jobs: |
| 23 | + build-and-upload-nightly-world-windows: |
| 24 | + runs-on: [pc] |
| 25 | + timeout-minutes: 30 |
| 26 | + env: |
| 27 | + workspace-path: "${{ github.workspace }}" |
| 28 | + source-path: "${{ github.workspace }}" |
| 29 | + release-path: "${{ github.workspace }}/tmp/release" |
| 30 | + add-packages-script-path: "${{ github.workspace }}/.github/workflow-scripts/add-user-package-to-vrc-get.js" |
| 31 | + get-serial-script-path: "${{ github.workspace }}/.github/workflow-scripts/get-serial-from-license-file.js" |
| 32 | + UNITY_PATH: "C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.22f1\\Editor\\Unity.exe" |
| 33 | + UNITY_SERIAL: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX |
| 34 | + steps: |
| 35 | + - name: Checkout Repository |
| 36 | + uses: actions/checkout@v3 |
| 37 | + with: |
| 38 | + fetch-depth: 0 |
| 39 | + |
| 40 | + - name: Download Release Package |
| 41 | + uses: robinraju/release-downloader@a96f54c1b5f5e09e47d9504526e96febd949d4c2 |
| 42 | + if: github.event_name == 'release' |
| 43 | + with: |
| 44 | + latest: true |
| 45 | + preRelease: false |
| 46 | + out-file-path: ${{ env.release-path }} |
| 47 | + fileName: "*.zip" |
| 48 | + extract: true |
| 49 | + |
| 50 | + - name: Setup vrc-get |
| 51 | + uses: anatawa12/sh-actions/setup-vrc-get@master |
| 52 | + |
| 53 | + - name: Add Release Pacakge to vrc-get |
| 54 | + if: github.event_name == 'release' |
| 55 | + run: "node ${{ env.add-packages-script-path }} ${{ env.release-path }}" |
| 56 | + |
| 57 | + - name: Add VPM Repositories |
| 58 | + run: | |
| 59 | + yes | vrc-get repo import repositories.txt |
| 60 | + vrc-get repo list |
| 61 | +
|
| 62 | + - name: Resolve VPM Dependencies |
| 63 | + working-directory: ${{ env.workspace-path }} |
| 64 | + run: "vrc-get resolve" |
| 65 | + |
| 66 | + - name: Remove Unsupported Packages |
| 67 | + working-directory: ${{ env.workspace-path }} |
| 68 | + shell: pwsh |
| 69 | + run: | |
| 70 | + $ErrorActionPreference = "SilentlyContinue" |
| 71 | + vrc-get remove dev.foxscore.easy-login au.benjithatfoxguy.templates.world.2022.3.22f1.updater com.nidonocu.vrcunitytoolbar au.benjithatfoxguy.batchimportunitypackage au.benjithatfoxguy.restartunity dev.hai-vr.resilience.let-me-see dev.hai-vr.resilience.toolkit unity-editor-dark-mode -y |
| 72 | + vrc-get remove numeira.auto-certify-copyright-agreement -y |
| 73 | +
|
| 74 | + - name: Add AutoBuild Packages to Workspace |
| 75 | + working-directory: ${{ env.workspace-path }} |
| 76 | + shell: pwsh |
| 77 | + run: | |
| 78 | + $ErrorActionPreference = "SilentlyContinue" |
| 79 | + vrc-get install com.yuxiaviation.vrchat.autobuild.world -y |
| 80 | +
|
| 81 | + - name: Downgrade VRCSDK to 3.7.1 |
| 82 | + working-directory: ${{ env.workspace-path }} |
| 83 | + run: | |
| 84 | + vrc-get remove com.vrchat.worlds com.vrchat.base -y |
| 85 | + vrc-get install com.vrchat.worlds 3.7.1 -y |
| 86 | + vrc-get install com.vrchat.base 3.7.1 -y |
| 87 | +
|
| 88 | + - name: Cache Library |
| 89 | + uses: actions/cache@v4 |
| 90 | + with: |
| 91 | + path: ${{ env.workspace-path }}/Library |
| 92 | + key: Library-Build-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} |
| 93 | + restore-keys: | |
| 94 | + Library-Build- |
| 95 | +
|
| 96 | + - name: Build & Upload VRChat World |
| 97 | + shell: pwsh |
| 98 | + run: | |
| 99 | + & "$env:UNITY_PATH" -nographics -projectPath "${{ env.workspace-path }}" -username "${{ secrets.UNITY_EMAIL }}" -password "${{ secrets.UNITY_PASSWORD }}" -serial "${{ env.UNITY_SERIAL }}" -batchmode -logFile - -buildTarget Win64 -executeMethod VRChatAerospaceUniversity.VRChatAutoBuild.Worlds.AutoBuildVRChatWorld.BuildAndUploadWorld |
| 100 | + env: |
| 101 | + VRC_AUTO_BUILD_CONTENT_ID: ${{ secrets.NIGHTLY_WORLD_CONTENT_ID }} |
| 102 | + VRC_AUTO_BUILD_SCENE_PATH: Assets/Scenes/VRCDefaultWorldScene.unity |
| 103 | + VRC_AUTO_BUILD_USERNAME: ${{ secrets.VRC_AUTO_BUILD_USERNAME }} |
| 104 | + VRC_AUTO_BUILD_PASSWORD: ${{ secrets.VRC_AUTO_BUILD_PASSWORD }} |
| 105 | + VRC_AUTO_BUILD_TOTP_KEY: ${{ secrets.VRC_AUTO_BUILD_TOTP_KEY }} |
| 106 | + VRC_AUTO_BUILD_AUTH_COOKIE: ${{ secrets.VRC_AUTO_BUILD_AUTH_COOKIE }} |
| 107 | + VRC_AUTO_BUILD_TWO_FACTOR_AUTH_COOKIE: ${{ secrets.VRC_AUTO_BUILD_TWO_FACTOR_AUTH_COOKIE }} |
0 commit comments