From 6b188ed5b31b1a028d1d19e5af12e67a65a0bcb4 Mon Sep 17 00:00:00 2001 From: Todor Pavlenkov <114268782+todor02@users.noreply.github.com> Date: Sat, 15 Nov 2025 16:00:20 +0000 Subject: [PATCH 01/19] Created Initial Github Action for push&pull requests | Spinning up a .net docker container and compiling --- .github/workflows/csharp-build.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/csharp-build.yml diff --git a/.github/workflows/csharp-build.yml b/.github/workflows/csharp-build.yml new file mode 100644 index 00000000..65adf791 --- /dev/null +++ b/.github/workflows/csharp-build.yml @@ -0,0 +1,22 @@ +name: Unity C# Compile Only + +on: [push, pull_request] + +jobs: + compile: + runs-on: ubuntu-latest + + container: + image: mcr.microsoft.com/dotnet/sdk:8.0 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Restore .NET packages + run: | + find . -name "*.csproj" -exec dotnet restore {} \; + + - name: Build C# scripts + run: | + find . -name "*.csproj" -exec dotnet build {} --configuration Release --no-restore \; From 7cb7edc38530921f849f1706e22e7027dc77d0b7 Mon Sep 17 00:00:00 2001 From: Todor Pavlenkov <114268782+todor02@users.noreply.github.com> Date: Sat, 15 Nov 2025 21:39:19 +0000 Subject: [PATCH 02/19] Creating an Windows VM and install Unity Editor to build an EXE --- .github/workflows/csharp-build.yml | 22 ---------------- .github/workflows/unity-exe-build.yml | 36 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/csharp-build.yml create mode 100644 .github/workflows/unity-exe-build.yml diff --git a/.github/workflows/csharp-build.yml b/.github/workflows/csharp-build.yml deleted file mode 100644 index 65adf791..00000000 --- a/.github/workflows/csharp-build.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Unity C# Compile Only - -on: [push, pull_request] - -jobs: - compile: - runs-on: ubuntu-latest - - container: - image: mcr.microsoft.com/dotnet/sdk:8.0 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Restore .NET packages - run: | - find . -name "*.csproj" -exec dotnet restore {} \; - - - name: Build C# scripts - run: | - find . -name "*.csproj" -exec dotnet build {} --configuration Release --no-restore \; diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml new file mode 100644 index 00000000..e17d2b80 --- /dev/null +++ b/.github/workflows/unity-exe-build.yml @@ -0,0 +1,36 @@ +name: Unity Windows Build EXE + +on: [push, pull_request] + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Detect Unity version + id: unityVersion + run: | + $version = (Select-String -Path "ProjectSettings/ProjectVersion.txt" -Pattern "m_EditorVersion").Line.Split()[1] + echo "VERSION=$version" >> $env:GITHUB_ENV + + - name: Install Unity ${{ env.VERSION }} + uses: game-ci/unity-installer@v3 + with: + unityVersion: ${{ env.VERSION }} + modules: windows-il2cpp + + - name: Build Windows Player + run: | + "C:\Program Files\Unity\Hub\Editor\${{ env.VERSION }}\Editor\Unity.exe" ` + -quit -batchmode -nographics ` + -projectPath . ` + -buildWindows64Player Build/Windows/UberStrike.exe + + - name: Upload Build Artifact + uses: actions/upload-artifact@v4 + with: + name: WindowsBuild + path: Build From cac5eb8a75c862f916790b2903db7b92222e2e0e Mon Sep 17 00:00:00 2001 From: Todor Pavlenkov <114268782+todor02@users.noreply.github.com> Date: Sat, 15 Nov 2025 21:59:00 +0000 Subject: [PATCH 03/19] Changing to version 4 and following docs recommendations --- .github/workflows/unity-exe-build.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml index e17d2b80..2f381b4d 100644 --- a/.github/workflows/unity-exe-build.yml +++ b/.github/workflows/unity-exe-build.yml @@ -1,6 +1,6 @@ name: Unity Windows Build EXE -on: [push, pull_request] +on: push jobs: build: @@ -16,21 +16,19 @@ jobs: $version = (Select-String -Path "ProjectSettings/ProjectVersion.txt" -Pattern "m_EditorVersion").Line.Split()[1] echo "VERSION=$version" >> $env:GITHUB_ENV - - name: Install Unity ${{ env.VERSION }} - uses: game-ci/unity-installer@v3 + - name: Build Windows 64-bit Player + uses: game-ci/unity-builder@v4 + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} with: + targetPlatform: StandaloneWindows64 unityVersion: ${{ env.VERSION }} - modules: windows-il2cpp - - - name: Build Windows Player - run: | - "C:\Program Files\Unity\Hub\Editor\${{ env.VERSION }}\Editor\Unity.exe" ` - -quit -batchmode -nographics ` - -projectPath . ` - -buildWindows64Player Build/Windows/UberStrike.exe + buildName: UberStrike.exe + buildsPath: Build - name: Upload Build Artifact uses: actions/upload-artifact@v4 with: name: WindowsBuild - path: Build + path: Build/StandaloneWindows64 \ No newline at end of file From 7671a967e6633a94b8876a713e2ba2caf2ef1602 Mon Sep 17 00:00:00 2001 From: Todor Pavlenkov <114268782+todor02@users.noreply.github.com> Date: Sat, 15 Nov 2025 23:19:29 +0000 Subject: [PATCH 04/19] Using Buildalon | docs: https://www.buildalon.com/docs/workflows/build --- .github/workflows/unity-exe-build.yml | 98 +++++++++++++++++++++------ 1 file changed, 78 insertions(+), 20 deletions(-) diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml index 2f381b4d..ed7ea369 100644 --- a/.github/workflows/unity-exe-build.yml +++ b/.github/workflows/unity-exe-build.yml @@ -1,34 +1,92 @@ -name: Unity Windows Build EXE +name: Unity EXE Build on: push jobs: build: - runs-on: windows-latest + env: + UNITY_PROJECT_PATH: '' + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [buildalon-windows] + include: + - os: buildalon-windows + build-target: StandaloneWindows64 + build-args: '' steps: - - name: Checkout repo + - name: Checkout repository uses: actions/checkout@v4 + with: + clean: ${{ github.event.inputs.clean == 'true' }} + lfs: true + submodules: 'recursive' + + - name: Setup Unity + uses: buildalon/unity-setup@v1 + with: + version-file: 'ProjectSettings/ProjectVersion.txt' + build-targets: '${{ matrix.build-target }}' + + - name: Activate Unity Personal License + uses: buildalon/activate-unity-license@v1 + with: + license: 'Personal' + username: '${{ secrets.UNITY_EMAIL }}' + password: '${{ secrets.UNITY_PASSWORD }}' - - name: Detect Unity version - id: unityVersion + - name: Add Build Pipeline Package + working-directory: ${{ env.UNITY_PROJECT_PATH }} run: | - $version = (Select-String -Path "ProjectSettings/ProjectVersion.txt" -Pattern "m_EditorVersion").Line.Split()[1] - echo "VERSION=$version" >> $env:GITHUB_ENV - - - name: Build Windows 64-bit Player - uses: game-ci/unity-builder@v4 - env: - UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} - UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + npm install -g openupm-cli + openupm add com.virtualmaker.buildalon + + - name: Project Validation + uses: buildalon/unity-action@v1 + with: + log-name: 'project-validation' + build-target: '${{ matrix.build-target }}' + args: '-quit -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject' + + - name: '${{ matrix.build-target }}-Build' + uses: buildalon/unity-action@v1 with: - targetPlatform: StandaloneWindows64 - unityVersion: ${{ env.VERSION }} - buildName: UberStrike.exe - buildsPath: Build + log-name: '${{ matrix.build-target }}-Build' + build-target: '${{ matrix.build-target }}' + args: '-quit -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild${{ matrix.build-args }}' - - name: Upload Build Artifact + - name: 'Upload ${{ matrix.build-target }} Artifacts' uses: actions/upload-artifact@v4 + id: upload-artifact + if: success() || failure() with: - name: WindowsBuild - path: Build/StandaloneWindows64 \ No newline at end of file + compression-level: 0 + retention-days: 1 + name: '${{ github.run_number }}.${{ github.run_attempt }}-${{ matrix.os }}-${{ matrix.build-target }}-Artifacts' + path: | + ${{ github.workspace }}/**/*.log + ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*.exe + ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*.dll + ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*_Data + ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/MonoBleedingEdge + + - name: Clean Artifacts + if: always() + shell: pwsh + run: | + # Clean Logs + Get-ChildItem -Path "${{ env.UNITY_PROJECT_PATH }}" -File -Filter "*.log" -Recurse | Remove-Item -Force + + $artifacts = "${{ env.UNITY_PROJECT_PATH }}/Builds" + Write-Host "::debug::Build artifacts path: $artifacts" + + if (Test-Path -Path $artifacts) { + try { + Remove-Item $artifacts -Recurse -Force + } catch { + Write-Warning "Failed to delete artifacts folder file: $_" + } + } else { + Write-Host "::debug::Artifacts folder not found." + } From b6788da3921f13e7436693218bcc3e714cb69f57 Mon Sep 17 00:00:00 2001 From: Todor Pavlenkov <114268782+todor02@users.noreply.github.com> Date: Sat, 15 Nov 2025 23:36:30 +0000 Subject: [PATCH 05/19] renaming file after adding buildalon (file name has to be unity-buildalon.yml) --- .github/workflows/unity-buildalon.yml | 117 ++++++++++++++++++++++++++ .github/workflows/unity-exe-build.yml | 92 -------------------- 2 files changed, 117 insertions(+), 92 deletions(-) create mode 100644 .github/workflows/unity-buildalon.yml delete mode 100644 .github/workflows/unity-exe-build.yml diff --git a/.github/workflows/unity-buildalon.yml b/.github/workflows/unity-buildalon.yml new file mode 100644 index 00000000..ef729f39 --- /dev/null +++ b/.github/workflows/unity-buildalon.yml @@ -0,0 +1,117 @@ +name: Buildalon Unity Build +on: + push: + branches: ['**'] + pull_request: + types: [opened, reopened, synchronize, ready_for_review] + branches: ['**'] + workflow_dispatch: + inputs: + clean: + description: 'Cleans the library folder and deletes cached items' + required: false + default: false + type: 'boolean' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{(github.event_name == 'pull_request' || github.event.action == 'synchronize')}} +jobs: + build: + name: (${{ matrix.os }}) ${{ matrix.build-target }} + if: github.event.pull_request.draft == false + permissions: + contents: read + env: + UNITY_PROJECT_PATH: '' + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [buildalon-windows] + include: + - os: buildalon-windows + build-target: StandaloneWindows64 + build-args: '' + steps: + - uses: actions/checkout@v5 + with: + clean: ${{ github.event.inputs.clean == 'true' }} + lfs: true + submodules: 'recursive' + - uses: buildalon/unity-setup@v2 + with: + build-targets: '${{ matrix.build-target }}' + - uses: buildalon/activate-unity-license@v2 + with: + license: 'Personal' + username: '${{ secrets.UNITY_USERNAME }}' + password: '${{ secrets.UNITY_PASSWORD }}' + - name: Add Build Pipeline Package + working-directory: ${{ env.UNITY_PROJECT_PATH }} + run: | + npm install -g openupm-cli + openupm add com.virtualmaker.buildalon + - uses: buildalon/unity-action@v3 + name: Project Validation + with: + log-name: project-validation + build-target: ${{ matrix.build-target }} + args: -quit -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject + - uses: buildalon/unity-action@v3 + name: ${{ matrix.build-target }}-Build + with: + log-name: ${{ matrix.build-target }}-Build + build-target: ${{ matrix.build-target }} + args: -quit -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild${{ matrix.build-args }} + - uses: actions/upload-artifact@v5 + id: upload-artifact + name: Upload ${{ matrix.build-target }} Artifacts + if: success() || failure() + with: + compression-level: 0 + retention-days: 1 + name: ${{ github.run_number }}.${{ github.run_attempt }}-${{ matrix.os }}-${{ matrix.build-target }}-Artifacts + path: | + ${{ github.workspace }}/**/*.log + ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*.exe + ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*.dll + ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*_Data + ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/MonoBleedingEdge/ + - name: Clean Artifacts + if: always() + shell: bash + continue-on-error: true + run: | + set -xe + echo "Cleaning logs..." + logs=$(find "${{ github.workspace }}" -type f -name "*.log") + echo "Found $(echo "$logs" | grep -v '^[[:space:]]*$' | wc -l) log files." + for log in $logs; do + if [ ! -s "$log" ]; then + continue + fi + echo "$log" + rm -f "$log" || echo "::warning::Failed to delete log file: $log" + done + + clean='${{ github.event.inputs.clean }}' + if [ "$clean" == 'true' ]; then + echo "Cleaning build artifacts..." + artifacts="${{ env.UNITY_PROJECT_PATH }}/Builds/${{ matrix.build-target }}" + echo "Build artifacts path $artifacts" + if [ -d "$artifacts" ]; then + items=$(find "$artifacts" -type f) + echo "Found artifacts folder with $(echo "$items" | grep -v '^[[:space:]]*$' | wc -l) items." + for item in $items; do + if [ ! -s "$item" ]; then + continue + fi + echo "$item" + rm -rf "$item" || echo "::warning::Failed to delete artifacts folder file: $item" + done + else + echo "Artifacts folder not found." + fi + rm -rf "${artifacts}" || echo "::warning::Failed to delete artifacts folder: $artifacts" + fi + + find "${{ env.UNITY_PROJECT_PATH }}" -type d -empty -delete || echo "::warning::Failed to delete some empty directories" diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml deleted file mode 100644 index ed7ea369..00000000 --- a/.github/workflows/unity-exe-build.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Unity EXE Build - -on: push - -jobs: - build: - env: - UNITY_PROJECT_PATH: '' - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [buildalon-windows] - include: - - os: buildalon-windows - build-target: StandaloneWindows64 - build-args: '' - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - clean: ${{ github.event.inputs.clean == 'true' }} - lfs: true - submodules: 'recursive' - - - name: Setup Unity - uses: buildalon/unity-setup@v1 - with: - version-file: 'ProjectSettings/ProjectVersion.txt' - build-targets: '${{ matrix.build-target }}' - - - name: Activate Unity Personal License - uses: buildalon/activate-unity-license@v1 - with: - license: 'Personal' - username: '${{ secrets.UNITY_EMAIL }}' - password: '${{ secrets.UNITY_PASSWORD }}' - - - name: Add Build Pipeline Package - working-directory: ${{ env.UNITY_PROJECT_PATH }} - run: | - npm install -g openupm-cli - openupm add com.virtualmaker.buildalon - - - name: Project Validation - uses: buildalon/unity-action@v1 - with: - log-name: 'project-validation' - build-target: '${{ matrix.build-target }}' - args: '-quit -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject' - - - name: '${{ matrix.build-target }}-Build' - uses: buildalon/unity-action@v1 - with: - log-name: '${{ matrix.build-target }}-Build' - build-target: '${{ matrix.build-target }}' - args: '-quit -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild${{ matrix.build-args }}' - - - name: 'Upload ${{ matrix.build-target }} Artifacts' - uses: actions/upload-artifact@v4 - id: upload-artifact - if: success() || failure() - with: - compression-level: 0 - retention-days: 1 - name: '${{ github.run_number }}.${{ github.run_attempt }}-${{ matrix.os }}-${{ matrix.build-target }}-Artifacts' - path: | - ${{ github.workspace }}/**/*.log - ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*.exe - ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*.dll - ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*_Data - ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/MonoBleedingEdge - - - name: Clean Artifacts - if: always() - shell: pwsh - run: | - # Clean Logs - Get-ChildItem -Path "${{ env.UNITY_PROJECT_PATH }}" -File -Filter "*.log" -Recurse | Remove-Item -Force - - $artifacts = "${{ env.UNITY_PROJECT_PATH }}/Builds" - Write-Host "::debug::Build artifacts path: $artifacts" - - if (Test-Path -Path $artifacts) { - try { - Remove-Item $artifacts -Recurse -Force - } catch { - Write-Warning "Failed to delete artifacts folder file: $_" - } - } else { - Write-Host "::debug::Artifacts folder not found." - } From 21810c4408d00bb9f0c0e1d1b09aeb9b09e07684 Mon Sep 17 00:00:00 2001 From: todor02 Date: Sun, 16 Nov 2025 14:02:46 +0200 Subject: [PATCH 06/19] Revert "renaming file after adding buildalon (file name has to be unity-buildalon.yml)" This reverts commit b6788da3921f13e7436693218bcc3e714cb69f57. Reverting commit to last non-"buildalon" commit --- .github/workflows/unity-buildalon.yml | 117 -------------------------- .github/workflows/unity-exe-build.yml | 92 ++++++++++++++++++++ 2 files changed, 92 insertions(+), 117 deletions(-) delete mode 100644 .github/workflows/unity-buildalon.yml create mode 100644 .github/workflows/unity-exe-build.yml diff --git a/.github/workflows/unity-buildalon.yml b/.github/workflows/unity-buildalon.yml deleted file mode 100644 index ef729f39..00000000 --- a/.github/workflows/unity-buildalon.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: Buildalon Unity Build -on: - push: - branches: ['**'] - pull_request: - types: [opened, reopened, synchronize, ready_for_review] - branches: ['**'] - workflow_dispatch: - inputs: - clean: - description: 'Cleans the library folder and deletes cached items' - required: false - default: false - type: 'boolean' -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{(github.event_name == 'pull_request' || github.event.action == 'synchronize')}} -jobs: - build: - name: (${{ matrix.os }}) ${{ matrix.build-target }} - if: github.event.pull_request.draft == false - permissions: - contents: read - env: - UNITY_PROJECT_PATH: '' - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [buildalon-windows] - include: - - os: buildalon-windows - build-target: StandaloneWindows64 - build-args: '' - steps: - - uses: actions/checkout@v5 - with: - clean: ${{ github.event.inputs.clean == 'true' }} - lfs: true - submodules: 'recursive' - - uses: buildalon/unity-setup@v2 - with: - build-targets: '${{ matrix.build-target }}' - - uses: buildalon/activate-unity-license@v2 - with: - license: 'Personal' - username: '${{ secrets.UNITY_USERNAME }}' - password: '${{ secrets.UNITY_PASSWORD }}' - - name: Add Build Pipeline Package - working-directory: ${{ env.UNITY_PROJECT_PATH }} - run: | - npm install -g openupm-cli - openupm add com.virtualmaker.buildalon - - uses: buildalon/unity-action@v3 - name: Project Validation - with: - log-name: project-validation - build-target: ${{ matrix.build-target }} - args: -quit -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject - - uses: buildalon/unity-action@v3 - name: ${{ matrix.build-target }}-Build - with: - log-name: ${{ matrix.build-target }}-Build - build-target: ${{ matrix.build-target }} - args: -quit -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild${{ matrix.build-args }} - - uses: actions/upload-artifact@v5 - id: upload-artifact - name: Upload ${{ matrix.build-target }} Artifacts - if: success() || failure() - with: - compression-level: 0 - retention-days: 1 - name: ${{ github.run_number }}.${{ github.run_attempt }}-${{ matrix.os }}-${{ matrix.build-target }}-Artifacts - path: | - ${{ github.workspace }}/**/*.log - ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*.exe - ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*.dll - ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*_Data - ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/MonoBleedingEdge/ - - name: Clean Artifacts - if: always() - shell: bash - continue-on-error: true - run: | - set -xe - echo "Cleaning logs..." - logs=$(find "${{ github.workspace }}" -type f -name "*.log") - echo "Found $(echo "$logs" | grep -v '^[[:space:]]*$' | wc -l) log files." - for log in $logs; do - if [ ! -s "$log" ]; then - continue - fi - echo "$log" - rm -f "$log" || echo "::warning::Failed to delete log file: $log" - done - - clean='${{ github.event.inputs.clean }}' - if [ "$clean" == 'true' ]; then - echo "Cleaning build artifacts..." - artifacts="${{ env.UNITY_PROJECT_PATH }}/Builds/${{ matrix.build-target }}" - echo "Build artifacts path $artifacts" - if [ -d "$artifacts" ]; then - items=$(find "$artifacts" -type f) - echo "Found artifacts folder with $(echo "$items" | grep -v '^[[:space:]]*$' | wc -l) items." - for item in $items; do - if [ ! -s "$item" ]; then - continue - fi - echo "$item" - rm -rf "$item" || echo "::warning::Failed to delete artifacts folder file: $item" - done - else - echo "Artifacts folder not found." - fi - rm -rf "${artifacts}" || echo "::warning::Failed to delete artifacts folder: $artifacts" - fi - - find "${{ env.UNITY_PROJECT_PATH }}" -type d -empty -delete || echo "::warning::Failed to delete some empty directories" diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml new file mode 100644 index 00000000..ed7ea369 --- /dev/null +++ b/.github/workflows/unity-exe-build.yml @@ -0,0 +1,92 @@ +name: Unity EXE Build + +on: push + +jobs: + build: + env: + UNITY_PROJECT_PATH: '' + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [buildalon-windows] + include: + - os: buildalon-windows + build-target: StandaloneWindows64 + build-args: '' + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + clean: ${{ github.event.inputs.clean == 'true' }} + lfs: true + submodules: 'recursive' + + - name: Setup Unity + uses: buildalon/unity-setup@v1 + with: + version-file: 'ProjectSettings/ProjectVersion.txt' + build-targets: '${{ matrix.build-target }}' + + - name: Activate Unity Personal License + uses: buildalon/activate-unity-license@v1 + with: + license: 'Personal' + username: '${{ secrets.UNITY_EMAIL }}' + password: '${{ secrets.UNITY_PASSWORD }}' + + - name: Add Build Pipeline Package + working-directory: ${{ env.UNITY_PROJECT_PATH }} + run: | + npm install -g openupm-cli + openupm add com.virtualmaker.buildalon + + - name: Project Validation + uses: buildalon/unity-action@v1 + with: + log-name: 'project-validation' + build-target: '${{ matrix.build-target }}' + args: '-quit -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject' + + - name: '${{ matrix.build-target }}-Build' + uses: buildalon/unity-action@v1 + with: + log-name: '${{ matrix.build-target }}-Build' + build-target: '${{ matrix.build-target }}' + args: '-quit -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild${{ matrix.build-args }}' + + - name: 'Upload ${{ matrix.build-target }} Artifacts' + uses: actions/upload-artifact@v4 + id: upload-artifact + if: success() || failure() + with: + compression-level: 0 + retention-days: 1 + name: '${{ github.run_number }}.${{ github.run_attempt }}-${{ matrix.os }}-${{ matrix.build-target }}-Artifacts' + path: | + ${{ github.workspace }}/**/*.log + ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*.exe + ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*.dll + ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*_Data + ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/MonoBleedingEdge + + - name: Clean Artifacts + if: always() + shell: pwsh + run: | + # Clean Logs + Get-ChildItem -Path "${{ env.UNITY_PROJECT_PATH }}" -File -Filter "*.log" -Recurse | Remove-Item -Force + + $artifacts = "${{ env.UNITY_PROJECT_PATH }}/Builds" + Write-Host "::debug::Build artifacts path: $artifacts" + + if (Test-Path -Path $artifacts) { + try { + Remove-Item $artifacts -Recurse -Force + } catch { + Write-Warning "Failed to delete artifacts folder file: $_" + } + } else { + Write-Host "::debug::Artifacts folder not found." + } From 82842adedfe6844fa21f9dbb5aa383b0bfcc5a26 Mon Sep 17 00:00:00 2001 From: todor02 Date: Sun, 16 Nov 2025 14:06:27 +0200 Subject: [PATCH 07/19] Revert "Using Buildalon | docs: https://www.buildalon.com/docs/workflows/build" This reverts commit 7671a967e6633a94b8876a713e2ba2caf2ef1602. PASS --- .github/workflows/unity-exe-build.yml | 98 ++++++--------------------- 1 file changed, 20 insertions(+), 78 deletions(-) diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml index ed7ea369..2f381b4d 100644 --- a/.github/workflows/unity-exe-build.yml +++ b/.github/workflows/unity-exe-build.yml @@ -1,92 +1,34 @@ -name: Unity EXE Build +name: Unity Windows Build EXE on: push jobs: build: - env: - UNITY_PROJECT_PATH: '' - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [buildalon-windows] - include: - - os: buildalon-windows - build-target: StandaloneWindows64 - build-args: '' + runs-on: windows-latest steps: - - name: Checkout repository + - name: Checkout repo uses: actions/checkout@v4 - with: - clean: ${{ github.event.inputs.clean == 'true' }} - lfs: true - submodules: 'recursive' - - - name: Setup Unity - uses: buildalon/unity-setup@v1 - with: - version-file: 'ProjectSettings/ProjectVersion.txt' - build-targets: '${{ matrix.build-target }}' - - - name: Activate Unity Personal License - uses: buildalon/activate-unity-license@v1 - with: - license: 'Personal' - username: '${{ secrets.UNITY_EMAIL }}' - password: '${{ secrets.UNITY_PASSWORD }}' - - name: Add Build Pipeline Package - working-directory: ${{ env.UNITY_PROJECT_PATH }} + - name: Detect Unity version + id: unityVersion run: | - npm install -g openupm-cli - openupm add com.virtualmaker.buildalon - - - name: Project Validation - uses: buildalon/unity-action@v1 - with: - log-name: 'project-validation' - build-target: '${{ matrix.build-target }}' - args: '-quit -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject' - - - name: '${{ matrix.build-target }}-Build' - uses: buildalon/unity-action@v1 + $version = (Select-String -Path "ProjectSettings/ProjectVersion.txt" -Pattern "m_EditorVersion").Line.Split()[1] + echo "VERSION=$version" >> $env:GITHUB_ENV + + - name: Build Windows 64-bit Player + uses: game-ci/unity-builder@v4 + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} with: - log-name: '${{ matrix.build-target }}-Build' - build-target: '${{ matrix.build-target }}' - args: '-quit -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild${{ matrix.build-args }}' + targetPlatform: StandaloneWindows64 + unityVersion: ${{ env.VERSION }} + buildName: UberStrike.exe + buildsPath: Build - - name: 'Upload ${{ matrix.build-target }} Artifacts' + - name: Upload Build Artifact uses: actions/upload-artifact@v4 - id: upload-artifact - if: success() || failure() with: - compression-level: 0 - retention-days: 1 - name: '${{ github.run_number }}.${{ github.run_attempt }}-${{ matrix.os }}-${{ matrix.build-target }}-Artifacts' - path: | - ${{ github.workspace }}/**/*.log - ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*.exe - ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*.dll - ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/**/*_Data - ${{ env.UNITY_PROJECT_PATH }}/Builds/StandaloneWindows64/MonoBleedingEdge - - - name: Clean Artifacts - if: always() - shell: pwsh - run: | - # Clean Logs - Get-ChildItem -Path "${{ env.UNITY_PROJECT_PATH }}" -File -Filter "*.log" -Recurse | Remove-Item -Force - - $artifacts = "${{ env.UNITY_PROJECT_PATH }}/Builds" - Write-Host "::debug::Build artifacts path: $artifacts" - - if (Test-Path -Path $artifacts) { - try { - Remove-Item $artifacts -Recurse -Force - } catch { - Write-Warning "Failed to delete artifacts folder file: $_" - } - } else { - Write-Host "::debug::Artifacts folder not found." - } + name: WindowsBuild + path: Build/StandaloneWindows64 \ No newline at end of file From 9bd587c276ba6691c7ae13006ff11d2fd856ba16 Mon Sep 17 00:00:00 2001 From: todor02 Date: Sun, 16 Nov 2025 14:07:14 +0200 Subject: [PATCH 08/19] Revert "Changing to version 4 and following docs recommendations" This reverts commit cac5eb8a75c862f916790b2903db7b92222e2e0e. PASS --- .github/workflows/unity-exe-build.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml index 2f381b4d..e17d2b80 100644 --- a/.github/workflows/unity-exe-build.yml +++ b/.github/workflows/unity-exe-build.yml @@ -1,6 +1,6 @@ name: Unity Windows Build EXE -on: push +on: [push, pull_request] jobs: build: @@ -16,19 +16,21 @@ jobs: $version = (Select-String -Path "ProjectSettings/ProjectVersion.txt" -Pattern "m_EditorVersion").Line.Split()[1] echo "VERSION=$version" >> $env:GITHUB_ENV - - name: Build Windows 64-bit Player - uses: game-ci/unity-builder@v4 - env: - UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} - UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + - name: Install Unity ${{ env.VERSION }} + uses: game-ci/unity-installer@v3 with: - targetPlatform: StandaloneWindows64 unityVersion: ${{ env.VERSION }} - buildName: UberStrike.exe - buildsPath: Build + modules: windows-il2cpp + + - name: Build Windows Player + run: | + "C:\Program Files\Unity\Hub\Editor\${{ env.VERSION }}\Editor\Unity.exe" ` + -quit -batchmode -nographics ` + -projectPath . ` + -buildWindows64Player Build/Windows/UberStrike.exe - name: Upload Build Artifact uses: actions/upload-artifact@v4 with: name: WindowsBuild - path: Build/StandaloneWindows64 \ No newline at end of file + path: Build From 5a82e330ec5197a22d4167be08135c665936009d Mon Sep 17 00:00:00 2001 From: todor02 Date: Sun, 16 Nov 2025 14:16:09 +0200 Subject: [PATCH 09/19] Reverted back changes to use game-ci and added github secret for license --- .github/workflows/unity-exe-build.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml index e17d2b80..b5243d77 100644 --- a/.github/workflows/unity-exe-build.yml +++ b/.github/workflows/unity-exe-build.yml @@ -1,6 +1,6 @@ name: Unity Windows Build EXE -on: [push, pull_request] +on: push jobs: build: @@ -16,21 +16,20 @@ jobs: $version = (Select-String -Path "ProjectSettings/ProjectVersion.txt" -Pattern "m_EditorVersion").Line.Split()[1] echo "VERSION=$version" >> $env:GITHUB_ENV - - name: Install Unity ${{ env.VERSION }} - uses: game-ci/unity-installer@v3 + - name: Build Windows 64-bit Player + uses: game-ci/unity-builder@v4 + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} with: + targetPlatform: StandaloneWindows64 unityVersion: ${{ env.VERSION }} - modules: windows-il2cpp - - - name: Build Windows Player - run: | - "C:\Program Files\Unity\Hub\Editor\${{ env.VERSION }}\Editor\Unity.exe" ` - -quit -batchmode -nographics ` - -projectPath . ` - -buildWindows64Player Build/Windows/UberStrike.exe + buildName: UberStrike.exe + buildPath: Build - name: Upload Build Artifact uses: actions/upload-artifact@v4 with: name: WindowsBuild - path: Build + path: Build/StandaloneWindows64 From 0cd9b4bd86f4253d982bef6737d1f0689fa5096a Mon Sep 17 00:00:00 2001 From: todor02 Date: Sun, 16 Nov 2025 17:34:08 +0200 Subject: [PATCH 10/19] 1. changing to pull request | 2. running on ubuntu-latest | 3. using cache | 4. removing unity version specifications | 5. removing unnecessary .exe from UberStrike (typo) --- .github/workflows/unity-exe-build.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml index b5243d77..8ec6fa81 100644 --- a/.github/workflows/unity-exe-build.yml +++ b/.github/workflows/unity-exe-build.yml @@ -1,22 +1,27 @@ name: Unity Windows Build EXE -on: push +on: + pull_request: + types: [ready_for_review] jobs: build: - runs-on: windows-latest + runs-on: ubuntu-latest steps: - - name: Checkout repo + - name: Checkout repository uses: actions/checkout@v4 - - name: Detect Unity version - id: unityVersion - run: | - $version = (Select-String -Path "ProjectSettings/ProjectVersion.txt" -Pattern "m_EditorVersion").Line.Split()[1] - echo "VERSION=$version" >> $env:GITHUB_ENV + - uses: actions/cache@v4 + with: + path: | + ~/.cache/unity3d + ~/.local/share/unity3d + key: Library-${{ runner.os }}-${{ hashFiles('**/ProjectSettings/ProjectVersion.txt') }} + restore-keys: | + Library-${{ runner.os }}- - - name: Build Windows 64-bit Player + - name: Build Windows Player uses: game-ci/unity-builder@v4 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} @@ -24,8 +29,7 @@ jobs: UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} with: targetPlatform: StandaloneWindows64 - unityVersion: ${{ env.VERSION }} - buildName: UberStrike.exe + buildName: UberStrike buildPath: Build - name: Upload Build Artifact From 50855c929313747832b9dbe2930a0e12a6d9ae68 Mon Sep 17 00:00:00 2001 From: todor02 Date: Sun, 16 Nov 2025 19:09:42 +0200 Subject: [PATCH 11/19] changing when to build, call --- .github/workflows/unity-exe-build.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml index 8ec6fa81..4e9efac9 100644 --- a/.github/workflows/unity-exe-build.yml +++ b/.github/workflows/unity-exe-build.yml @@ -1,11 +1,11 @@ name: Unity Windows Build EXE on: - pull_request: - types: [ready_for_review] + pull_request jobs: build: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: @@ -14,12 +14,10 @@ jobs: - uses: actions/cache@v4 with: - path: | - ~/.cache/unity3d - ~/.local/share/unity3d - key: Library-${{ runner.os }}-${{ hashFiles('**/ProjectSettings/ProjectVersion.txt') }} + path: Library + key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} restore-keys: | - Library-${{ runner.os }}- + Library- - name: Build Windows Player uses: game-ci/unity-builder@v4 From d5d5b988c07566a91d639967cc289cf9be00e063 Mon Sep 17 00:00:00 2001 From: todor02 Date: Wed, 19 Nov 2025 09:38:11 +0200 Subject: [PATCH 12/19] CI: Optimize Unity Windows build for GitHub Actions - Cache Library, Logs, and obj to speed up builds - Add disk cleanup step to free space before Unity build - Remove preinstalled dotnet, GHC, Android SDK, Boost, and clean apt cache - Set customParameters: -quit -batchmode -nographics - Fix Docker 'no space left on device' issue --- .github/workflows/unity-exe-build.yml | 28 ++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml index 4e9efac9..3e16e6ae 100644 --- a/.github/workflows/unity-exe-build.yml +++ b/.github/workflows/unity-exe-build.yml @@ -12,13 +12,34 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - uses: actions/cache@v4 + - name: Cache + uses: actions/cache@v4 with: - path: Library + path: | + Library + Logs + obj key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} restore-keys: | Library- + - name: Check disk space before cleanup + run: df -h + + - name: Free space on runner + run: | + sudo docker system prune -a -f + sudo docker volume prune -f + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf /usr/local/lib/android + sudo rm -rf /usr/local/share/boost + sudo apt-get clean + sudo rm -rf /var/lib/apt/lists/* + + - name: Check disk space after cleanup + run: df -h + - name: Build Windows Player uses: game-ci/unity-builder@v4 env: @@ -28,7 +49,8 @@ jobs: with: targetPlatform: StandaloneWindows64 buildName: UberStrike - buildPath: Build + buildsPath: Build + customParameters: -quit -batchmode -nographics - name: Upload Build Artifact uses: actions/upload-artifact@v4 From 7999c37cb713aa7875c2ce3749d398fc5b0293ab Mon Sep 17 00:00:00 2001 From: todor02 Date: Wed, 19 Nov 2025 09:50:48 +0200 Subject: [PATCH 13/19] Removing -quit -batchmode because it's already in the game-ci/unity-builder --- .github/workflows/unity-exe-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml index 3e16e6ae..06d2259d 100644 --- a/.github/workflows/unity-exe-build.yml +++ b/.github/workflows/unity-exe-build.yml @@ -50,7 +50,7 @@ jobs: targetPlatform: StandaloneWindows64 buildName: UberStrike buildsPath: Build - customParameters: -quit -batchmode -nographics + customParameters: -nographics - name: Upload Build Artifact uses: actions/upload-artifact@v4 From dfd66c6411d7306d1fb0a0a73dbbbd0996bf821b Mon Sep 17 00:00:00 2001 From: todor02 Date: Wed, 19 Nov 2025 12:07:53 +0200 Subject: [PATCH 14/19] reverting some deletions --- .github/workflows/unity-exe-build.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml index 06d2259d..6b700d93 100644 --- a/.github/workflows/unity-exe-build.yml +++ b/.github/workflows/unity-exe-build.yml @@ -23,22 +23,13 @@ jobs: restore-keys: | Library- - - name: Check disk space before cleanup - run: df -h - - name: Free space on runner run: | - sudo docker system prune -a -f - sudo docker volume prune -f - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf /usr/local/lib/android - sudo rm -rf /usr/local/share/boost + df -h + sudo rm -rf /tmp/* sudo apt-get clean sudo rm -rf /var/lib/apt/lists/* - - - name: Check disk space after cleanup - run: df -h + df -h - name: Build Windows Player uses: game-ci/unity-builder@v4 From 316b635f4310f058d7dd950f59b6f89c80a1fdfd Mon Sep 17 00:00:00 2001 From: todor02 Date: Wed, 19 Nov 2025 12:19:18 +0200 Subject: [PATCH 15/19] removing free-up-space part --- .github/workflows/unity-exe-build.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml index 6b700d93..7c93ac88 100644 --- a/.github/workflows/unity-exe-build.yml +++ b/.github/workflows/unity-exe-build.yml @@ -23,14 +23,6 @@ jobs: restore-keys: | Library- - - name: Free space on runner - run: | - df -h - sudo rm -rf /tmp/* - sudo apt-get clean - sudo rm -rf /var/lib/apt/lists/* - df -h - - name: Build Windows Player uses: game-ci/unity-builder@v4 env: From 7e23fafcae57e0649f9be4310020e7f4b590a957 Mon Sep 17 00:00:00 2001 From: todor02 Date: Wed, 19 Nov 2025 14:21:31 +0200 Subject: [PATCH 16/19] Changing back to running on windows for reliability --- .github/workflows/unity-exe-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml index 7c93ac88..e84c390d 100644 --- a/.github/workflows/unity-exe-build.yml +++ b/.github/workflows/unity-exe-build.yml @@ -6,7 +6,7 @@ on: jobs: build: if: github.event.pull_request.draft == false - runs-on: ubuntu-latest + runs-on: windows-latest steps: - name: Checkout repository From 9fa4273337c2dfacce68d8d83bf8b51a5591e514 Mon Sep 17 00:00:00 2001 From: todor02 Date: Wed, 19 Nov 2025 14:44:17 +0200 Subject: [PATCH 17/19] removing custom parameters because they are already included for windows runner --- .github/workflows/unity-exe-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml index e84c390d..4815c8a5 100644 --- a/.github/workflows/unity-exe-build.yml +++ b/.github/workflows/unity-exe-build.yml @@ -33,7 +33,6 @@ jobs: targetPlatform: StandaloneWindows64 buildName: UberStrike buildsPath: Build - customParameters: -nographics - name: Upload Build Artifact uses: actions/upload-artifact@v4 From 3db8c4e877a0ea8e71b4561c1b4ae9a99e724ac5 Mon Sep 17 00:00:00 2001 From: Todor Pavlenkov <114268782+todor02@users.noreply.github.com> Date: Thu, 20 Nov 2025 10:04:35 +0200 Subject: [PATCH 18/19] Update cache paths in unity-exe-build.yml Removed 'Logs' and 'obj' from cache paths in Unity build workflow. --- .github/workflows/unity-exe-build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/unity-exe-build.yml b/.github/workflows/unity-exe-build.yml index 4815c8a5..f8eed63e 100644 --- a/.github/workflows/unity-exe-build.yml +++ b/.github/workflows/unity-exe-build.yml @@ -17,8 +17,6 @@ jobs: with: path: | Library - Logs - obj key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} restore-keys: | Library- From 7ef3824f6fa22b399bdd24b9c14916103ea81ab5 Mon Sep 17 00:00:00 2001 From: todor02 Date: Thu, 20 Nov 2025 13:05:22 +0200 Subject: [PATCH 19/19] dummy