fix prerelease vs release itch discrepancy #549
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: Build - Windows | |
| on: | |
| push: | |
| branches: | |
| - "*" | |
| - "release/*" | |
| # https://github.com/SoopMod/source-sdk-tf-soop/commit/d244e93b5888074e53e1f2f6daba3f14383b575e | |
| jobs: | |
| build_win: | |
| runs-on: windows-2025-vs2026 | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/../vcpkg | |
| VCPKG_DEFAULT_TRIPLET: x64-windows | |
| steps: | |
| # checkout the github actions / workflow | |
| - name: Checkout actions | |
| uses: actions/checkout@v6 | |
| with: | |
| sparse-checkout: | | |
| .github | |
| token: ${{ secrets.REPO_TOKEN }} | |
| # Support incremental builds by caching (almost) the entire workspace. | |
| # | |
| # Caching the build outputs alone won't do since missing files will be created with current | |
| # mtimes. | |
| - name: Setup msbuild cache | |
| id: setup-msbuild-cache | |
| uses: actions/cache@v4 | |
| with: | |
| # we ignore all git / project stuff that isn't a build input | |
| # we also ignore build outputs. technically these should be cached | |
| # but it's just a simply bin copy in this case, so it isn't really needed | |
| # and just bloats the cache | |
| # also ignore archives from releases | |
| path: | | |
| ${{ github.workspace }} | |
| !${{ github.workspace }}/.git/** | |
| !${{ github.workspace }}/.github/** | |
| !${{ github.workspace }}/.vscode/** | |
| !${{ github.workspace }}/game_clean/** | |
| !${{ github.workspace }}/game_dist/** | |
| !${{ github.workspace }}/game_dist_debug/** | |
| !${{ github.workspace }}/team-comtress-2.png | |
| !${{ github.workspace }}/.gitattributes | |
| !${{ github.workspace }}/.gitignore | |
| !${{ github.workspace }}/CONTRIBUTING | |
| !${{ github.workspace }}/LICENSE | |
| !${{ github.workspace }}/README.md | |
| !${{ github.workspace }}/thirdpartylegalnotices.txt | |
| !${{ github.workspace }}/game-win.zip | |
| key: ${{ runner.os }}-mscache-${{ github.ref_name }}-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-mscache-${{ github.ref_name }}- | |
| ${{ runner.os }}-mscache-${{ github.base_ref }}- | |
| ${{ runner.os }}-mscache-tc2-mod- | |
| # Replace changed files with those from the current ref. | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| clean: false | |
| token: ${{ secrets.REPO_TOKEN }} | |
| submodules: recursive | |
| - name: Add msbuild | |
| uses: microsoft/setup-msbuild@v1.0.2 | |
| - name: Prepare project solution | |
| shell: cmd | |
| working-directory: "${{ github.workspace }}/src" | |
| run: '.\createallprojects.bat' | |
| - name: Install dependencies | |
| run: | | |
| cd .. | |
| git clone https://github.com/microsoft/vcpkg.git | |
| cd vcpkg | |
| .\bootstrap-vcpkg.bat | |
| .\vcpkg integrate install | |
| .\vcpkg install crow | |
| - name: Build solution | |
| shell: cmd | |
| working-directory: "${{ github.workspace }}/src" | |
| run: | | |
| msbuild everything.sln /p:Platform="win64" /p:Configuration="Release" | |
| - name: Copy dist | |
| id: copy-dist | |
| run: | | |
| rm -f ./game/tc2/pak1*.vpk | |
| ./game_clean/copy.sh | |
| shell: bash | |
| - name: Archive production artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: game | |
| path: | | |
| game_dist | |
| - name: Archive debug info | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: game-debug-info | |
| path: | | |
| game_dist_debug | |
| - name: Package Release | |
| id: package-rel | |
| if: ${{ (github.repository_owner == 'mastercomfig' || github.repository_owner == 'mastercoms') && github.event_name == 'push' && (github.ref == 'refs/heads/tc2-mod' || startsWith(github.ref, 'refs/heads/release/')) }} | |
| run: | | |
| Remove-Item -Recurse -Force .\game_dist_debug | |
| Compress-Archive -Path .\game_dist\* -DestinationPath game-win.zip | |
| - name: Setup Butler | |
| id: setup-butler | |
| if: ${{ (github.repository_owner == 'mastercomfig' || github.repository_owner == 'mastercoms') && github.event_name == 'push' && (github.ref == 'refs/heads/tc2-mod' || startsWith(github.ref, 'refs/heads/release/')) }} | |
| run: | | |
| New-Item -Path "$Env:USERPROFILE\.bin" -ItemType Directory | |
| curl.exe -sSL --fail --retry 2 --max-time 10 "https://broth.itch.zone/butler/windows-amd64/LATEST/archive/default" -OutFile cibin/butler/windows/butler.zip || true | |
| Expand-Archive -Path cibin/butler/windows/butler.zip -DestinationPath "$Env:USERPROFILE\.bin" -Force | |
| $Env:Path += ";$Env:USERPROFILE\.bin;" | |
| [System.Environment]::SetEnvironmentVariable("PATH", $Env:Path, "User") | |
| butler -V | |
| - name: Push to Itch (prerelease) | |
| id: itch-prerelease | |
| if: ${{ (github.repository_owner == 'mastercomfig' || github.repository_owner == 'mastercoms') && github.event_name == 'push' && (github.ref == 'refs/heads/tc2-mod' || startsWith(github.ref, 'refs/heads/release/')) }} | |
| run: | | |
| BRANCH_STR=prerelease ./game_clean/push.sh game_dist | |
| shell: bash | |
| env: | |
| BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }} | |
| - name: Push Release | |
| id: create-rel | |
| if: ${{ (github.repository_owner == 'mastercomfig' || github.repository_owner == 'mastercoms') && github.event_name == 'push' && (github.ref == 'refs/heads/tc2-mod' || startsWith(github.ref, 'refs/heads/release/')) }} | |
| run: | | |
| ./game_clean/tag.sh | |
| rm game-win.zip | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{secrets.REPO_TOKEN}} |