forked from ValveSoftware/source-sdk-2013
-
-
Notifications
You must be signed in to change notification settings - Fork 19
159 lines (143 loc) · 5.55 KB
/
Copy pathbuild_windows.yml
File metadata and controls
159 lines (143 loc) · 5.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Build - Windows
on:
push:
branches:
- "*"
# 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: Setup Butler
# id: setup-butler
# run: |
# New-Item -Path "$Env:USERPROFILE\.bin" -ItemType Directory
# Invoke-WebRequest -Uri "https://broth.itch.zone/butler/windows-amd64/LATEST/archive/default" -OutFile butler.zip
# Expand-Archive -Path butler.zip -DestinationPath "$Env:USERPROFILE\.bin" -Force
# Remove-Item butler.zip
# $Env:Path += ";$Env:USERPROFILE\.bin;"
# [System.Environment]::SetEnvironmentVariable("PATH", $Env:Path, "User")
# butler -V
- name: Setup Butler
id: setup-butler
run: |
New-Item -Path "$Env:USERPROFILE\.bin" -ItemType Directory
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: 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: Push to Itch
id: itch
if: ${{ github.repository_owner == 'mastercomfig' && github.event_name == 'push' && github.ref == 'refs/heads/tc2-mod' }}
run: |
PATH="${PATH}:${HOME}/.bin"
./game_clean/push.sh
shell: bash
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
- 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: Push Permalink Rel
id: perma-rel
if: ${{ github.repository_owner == 'mastercomfig' && github.event_name == 'push' && github.ref == 'refs/heads/tc2-mod' }}
run: |
Remove-Item -Recurse -Force .\game_dist_debug
Compress-Archive -Path .\game_dist\* -DestinationPath game-win.zip
gh release upload --clobber rel game-win.zip
env:
GH_TOKEN: ${{secrets.REPO_TOKEN}}
- name: Push Release
id: create-rel
if: ${{ github.repository_owner == 'mastercomfig' && github.event_name == 'push' && github.ref == 'refs/heads/tc2-mod' }}
run: |
./game_clean/tag.sh
rm game-win.zip
shell: bash
env:
GH_TOKEN: ${{secrets.REPO_TOKEN}}