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 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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 6/9] 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 7/9] 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 8/9] 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 9/9] 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