Skip to content

Commit 3fd9d80

Browse files
committed
[ci] Try to move common things to action
1 parent e645c0f commit 3fd9d80

File tree

19 files changed

+226
-127
lines changed

19 files changed

+226
-127
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: 'Setup Build'
2+
description: 'Setup env & generate solution'
3+
4+
inputs:
5+
platform-name:
6+
description: 'Platform name <x86, x64, arm64>'
7+
required: true
8+
configuration-name:
9+
description: 'Configuration name <Debug / Release>'
10+
required: true
11+
solution-name:
12+
description: 'Solution name to generate'
13+
required: true
14+
15+
runs:
16+
using: "composite"
17+
steps:
18+
- name: Add MSBuild to PATH
19+
uses: microsoft/setup-msbuild@v2
20+
with:
21+
msbuild-architecture: ${{matrix.platform-name}}
22+
23+
- name: Add cmake / nmake to PATH
24+
uses: ilammy/msvc-dev-cmd@v1
25+
with:
26+
arch: ${{inputs.platform-name}}
27+
28+
- name: 'Build dependencies for ${{inputs.solution-name}}_${{inputs.platform-name}}.sln'
29+
working-directory: ${{env.GITHUB_WORKSPACE}}
30+
run: .\build_game_thirdparty.bat ${{inputs.platform-name}}
31+
shell: cmd
32+
33+
- name: 'Generate solution ${{inputs.solution-name}}_${{inputs.platform-name}}.sln'
34+
working-directory: ${{env.GITHUB_WORKSPACE}}
35+
run: .\create_game_projects.bat ${{inputs.solution-name}} ${{inputs.platform-name}}
36+
shell: cmd
37+
38+
- name: '${{inputs.configuration-name}} build solution ${{inputs.solution-name}}_${{inputs.platform-name}}.sln'
39+
working-directory: ${{env.GITHUB_WORKSPACE}}
40+
run: msbuild ${{inputs.solution-name}}_${{inputs.platform-name}}.sln /m -verbosity:minimal /p:Configuration=${{inputs.configuration-name}} /p:Platform=${{inputs.platform-name}}
41+
shell: cmd

.github/workflows/build.yml

Lines changed: 42 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: 'Build'
22

33
on:
44
push:
@@ -7,173 +7,117 @@ on:
77
branches: [ "master" ]
88

99
env:
10-
HL2_SOLUTION_NAME_BASE: hl2
11-
HL2_LOASTCOAST_SOLUTION_NAME_BASE: loastcoast
12-
HL2_EPISODIC_SOLUTION_NAME_BASE: episodic
13-
HL2_MP_SOLUTION_NAME_BASE: hl2mp
14-
PORTAL_SOLUTION_NAME_BASE: portal
10+
HL2_SOLUTION_NAME: hl2
11+
HL2_LOASTCOAST_SOLUTION_NAME: loastcoast
12+
HL2_EPISODIC_SOLUTION_NAME: episodic
13+
HL2_DEATHMATCH_SOLUTION_NAME: hl2mp
14+
PORTAL_SOLUTION_NAME: portal
1515

1616
permissions:
1717
contents: read
1818

1919
jobs:
2020
build_hl2:
21-
name: Build Half-Life 2
21+
name: 'Build Half-Life 2'
2222
runs-on: windows-latest
2323
strategy:
2424
matrix:
2525
platform: [x86, x64]
2626
configuration: [Debug, Release]
2727

2828
steps:
29-
- name: Checkout repository and submodules
29+
- name: 'Checkout Half-Life 2 repo & submodules'
3030
uses: actions/checkout@v4
3131
with:
3232
submodules: recursive
3333

34-
- name: Add MSBuild to PATH
35-
uses: microsoft/setup-msbuild@v2
34+
- name: 'Setup & build'
35+
uses: ./.github/actions/build-shared
3636
with:
37-
msbuild-architecture: ${{matrix.platform}}
38-
39-
- name: Add cmake / nmake to PATH
40-
uses: ilammy/msvc-dev-cmd@v1
41-
with:
42-
arch: ${{matrix.platform}}
43-
44-
- name: Build dependencies & generate solution
45-
working-directory: ${{env.GITHUB_WORKSPACE}}
46-
run: .\create_hl2_dev_${{matrix.platform}}.bat
47-
48-
- name: Build app
49-
working-directory: ${{env.GITHUB_WORKSPACE}}
50-
run: msbuild ${{env.HL2_SOLUTION_NAME_BASE}}_${{matrix.platform}}.sln /m -verbosity:minimal /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}}
37+
platform-name: ${{matrix.platform}}
38+
configuration-name: ${{matrix.configuration}}
39+
solution-name: ${{env.HL2_SOLUTION_NAME}}
5140

5241
build_hl2_loastcoast:
53-
name: Build Half-Life 2 Loast Coast
42+
name: 'Build Half-Life 2: Loast Coast'
5443
runs-on: windows-latest
5544
strategy:
5645
matrix:
5746
platform: [x86, x64]
5847
configuration: [Debug, Release]
5948

6049
steps:
61-
- name: Checkout repository and submodules
50+
- name: 'Checkout Half-Life 2: Loast Coast repo & submodules'
6251
uses: actions/checkout@v4
6352
with:
6453
submodules: recursive
6554

66-
- name: Add MSBuild to PATH
67-
uses: microsoft/setup-msbuild@v2
68-
with:
69-
msbuild-architecture: ${{matrix.platform}}
70-
71-
- name: Add cmake / nmake to PATH
72-
uses: ilammy/msvc-dev-cmd@v1
55+
- name: 'Setup & build'
56+
uses: ./.github/actions/build-shared
7357
with:
74-
arch: ${{matrix.platform}}
75-
76-
- name: Build dependencies & generate solution
77-
working-directory: ${{env.GITHUB_WORKSPACE}}
78-
run: .\create_hl2_loastcoast_dev_${{matrix.platform}}.bat
79-
80-
- name: Build app
81-
working-directory: ${{env.GITHUB_WORKSPACE}}
82-
run: msbuild ${{env.HL2_LOASTCOAST_SOLUTION_NAME_BASE}}_${{matrix.platform}}.sln /m -verbosity:minimal /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}}
58+
platform-name: ${{matrix.platform}}
59+
configuration-name: ${{matrix.configuration}}
60+
solution-name: ${{env.HL2_LOASTCOAST_SOLUTION_NAME}}
8361

8462
build_hl2_episodic:
85-
name: Build Half-Life 2 Episode 1 & 2
63+
name: 'Build Half-Life 2: Episode 1 & 2'
8664
runs-on: windows-latest
8765
strategy:
8866
matrix:
8967
platform: [x86, x64]
9068
configuration: [Debug, Release]
9169

9270
steps:
93-
- name: Checkout repository and submodules
71+
- name: 'Checkout Half-Life 2: Episode 1 & 2 repo & submodules'
9472
uses: actions/checkout@v4
9573
with:
9674
submodules: recursive
9775

98-
- name: Add MSBuild to PATH
99-
uses: microsoft/setup-msbuild@v2
76+
- name: 'Setup & build'
77+
uses: ./.github/actions/build-shared
10078
with:
101-
msbuild-architecture: ${{matrix.platform}}
102-
103-
- name: Add cmake / nmake to PATH
104-
uses: ilammy/msvc-dev-cmd@v1
105-
with:
106-
arch: ${{matrix.platform}}
107-
108-
- name: Build dependencies & generate solution
109-
working-directory: ${{env.GITHUB_WORKSPACE}}
110-
run: .\create_hl2_ep1_2_dev_${{matrix.platform}}.bat
79+
platform-name: ${{matrix.platform}}
80+
configuration-name: ${{matrix.configuration}}
81+
solution-name: ${{env.HL2_EPISODIC_SOLUTION_NAME}}
11182

112-
- name: Build app
113-
working-directory: ${{env.GITHUB_WORKSPACE}}
114-
run: msbuild ${{env.HL2_EPISODIC_SOLUTION_NAME_BASE}}_${{matrix.platform}}.sln /m -verbosity:minimal /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}}
115-
116-
build_hl2_mp:
117-
name: Build Half-Life 2 Deathmatch
83+
build_hl2_deathmatch:
84+
name: 'Build Half-Life 2: Deathmatch'
11885
runs-on: windows-latest
11986
strategy:
12087
matrix:
12188
platform: [x86, x64]
12289
configuration: [Debug, Release]
12390

12491
steps:
125-
- name: Checkout repository and submodules
92+
- name: 'Checkout Half-Life 2: Deathmatch repo & submodules'
12693
uses: actions/checkout@v4
12794
with:
12895
submodules: recursive
12996

130-
- name: Add MSBuild to PATH
131-
uses: microsoft/setup-msbuild@v2
132-
with:
133-
msbuild-architecture: ${{matrix.platform}}
134-
135-
- name: Add cmake / nmake to PATH
136-
uses: ilammy/msvc-dev-cmd@v1
97+
- name: 'Setup & build'
98+
uses: ./.github/actions/build-shared
13799
with:
138-
arch: ${{matrix.platform}}
139-
140-
- name: Build dependencies & generate solution
141-
working-directory: ${{env.GITHUB_WORKSPACE}}
142-
run: .\create_hl2_mp_dev_${{matrix.platform}}.bat
143-
144-
- name: Build app
145-
working-directory: ${{env.GITHUB_WORKSPACE}}
146-
run: msbuild ${{env.HL2_MP_SOLUTION_NAME_BASE}}_${{matrix.platform}}.sln /m -verbosity:minimal /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}}
100+
platform-name: ${{matrix.platform}}
101+
configuration-name: ${{matrix.configuration}}
102+
solution-name: ${{env.HL2_DEATHMATCH_SOLUTION_NAME}}
147103

148104
build_portal:
149-
name: Build Portal
105+
name: 'Build Portal'
150106
runs-on: windows-latest
151107
strategy:
152108
matrix:
153109
platform: [x86, x64]
154110
configuration: [Debug, Release]
155111

156112
steps:
157-
- name: Checkout repository and submodules
113+
- name: 'Checkout Portal repo & submodules'
158114
uses: actions/checkout@v4
159115
with:
160116
submodules: recursive
161117

162-
- name: Add MSBuild to PATH
163-
uses: microsoft/setup-msbuild@v2
118+
- name: 'Setup & build'
119+
uses: ./.github/actions/build-shared
164120
with:
165-
msbuild-architecture: ${{matrix.platform}}
166-
167-
- name: Add cmake / nmake to PATH
168-
uses: ilammy/msvc-dev-cmd@v1
169-
with:
170-
arch: ${{matrix.platform}}
171-
172-
- name: Build dependencies & generate solution
173-
working-directory: ${{env.GITHUB_WORKSPACE}}
174-
run: .\create_portal_dev_${{matrix.platform}}.bat
175-
176-
- name: Build app
177-
working-directory: ${{env.GITHUB_WORKSPACE}}
178-
run: msbuild ${{env.PORTAL_SOLUTION_NAME_BASE}}_${{matrix.platform}}.sln /m -verbosity:minimal /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}}
179-
121+
platform-name: ${{matrix.platform}}
122+
configuration-name: ${{matrix.configuration}}
123+
solution-name: ${{env.PORTAL_SOLUTION_NAME}}

.slnitems

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
.editorconfig
33
.gitignore
44
.github\workflows\build.yml
5+
.github\actions\build-shared\action.yml
56
.slnitems
67
LICENSE
78
README.md
9+
SECURITY.md
810
CMakeLists.txt

SECURITY.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Security
2+
3+
The Source Authors takes the security of our software products and services
4+
seriously, which includes all source code repositories managed through our
5+
GitHub organization, which include
6+
[Source-Authors](https://github.com/Source-Authors).
7+
8+
If you believe you have found a security vulnerability in any
9+
Source-Authors-owned repository that meets
10+
[NIST Computer Security Resource Center definition of a security vulnerability](https://csrc.nist.gov/glossary/term/vulnerability),
11+
please report it to us as described below.
12+
13+
## Reporting Security Issues
14+
15+
**Please do not report security vulnerabilities through public GitHub issues.**
16+
17+
Instead, please send email to
18+
[secure.whitebox.authors@gmail.com](mailto:secure.whitebox.authors@gmail.com).
19+
20+
You should receive a response within 24 hours. If for some reason you do not,
21+
please follow up via email to ensure we received your original message.
22+
23+
Please include the requested information listed below (as much as you can
24+
provide) to help us better understand the nature and scope of the possible
25+
issue:
26+
27+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting,
28+
etc.)
29+
* Full paths of source file(s) related to the manifestation of the issue
30+
* The location of the affected source code (tag/branch/commit or direct URL)
31+
* Any special configuration required to reproduce the issue
32+
* Step-by-step instructions to reproduce the issue
33+
* Proof-of-concept or exploit code (if possible)
34+
* Impact of the issue, including how an attacker might exploit the issue
35+
36+
This information will help us triage your report more quickly.
37+
38+
## Preferred Languages
39+
40+
We prefer all communications to be in English.
41+
42+
## Policy
43+
44+
Source-Authors follows the principle of
45+
[ISO/IEC 29147:2018 Information technology — Security techniques — Vulnerability disclosure](https://www.iso.org/standard/72311.html).

build_game_thirdparty.bat

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ POPD
121121
REM Build mpaheaderinfo.
122122
MKDIR thirdparty\mpaheaderinfo\out
123123
PUSHD thirdparty\mpaheaderinfo\out
124-
cmake -G %CMAKE_MSVC_GEN_NAME% -A %CMAKE_MSVC_ARCH_NAME% -DMPA_BUILD_WITHOUT_ATL=ON ..
124+
cmake -G %CMAKE_MSVC_GEN_NAME% -A %CMAKE_MSVC_ARCH_NAME% -DSA_MPA_BUILD_WITHOUT_ATL=ON ..
125125
if ERRORLEVEL 1 (
126126
ECHO cmake generation for thirdparty\mpaheaderinfo failed.
127127
EXIT /B 1
@@ -223,15 +223,21 @@ if ERRORLEVEL 1 (
223223
REM Build zip-utils.
224224
MKDIR thirdparty\zip-utils\out
225225
PUSHD thirdparty\zip-utils\out
226-
cmake -G Ninja ..
226+
cmake -G %CMAKE_MSVC_GEN_NAME% -A %CMAKE_MSVC_ARCH_NAME% ..
227227
if ERRORLEVEL 1 (
228228
ECHO cmake generation for thirdparty\zip-utils failed.
229229
EXIT /B 1
230230
)
231231

232+
cmake --build . --config Debug
233+
if ERRORLEVEL 1 (
234+
ECHO cmake --build Debug for thirdparty\zip-utils failed.
235+
EXIT /B 1
236+
)
237+
232238
cmake --build . --config Release
233239
if ERRORLEVEL 1 (
234-
ECHO cmake --build for thirdparty\zip-utils failed.
240+
ECHO cmake --build Release for thirdparty\zip-utils failed.
235241
EXIT /B 1
236242
)
237243
POPD
@@ -248,11 +254,4 @@ if ERRORLEVEL 1 (
248254
POPD
249255

250256

251-
REM Build VPC.
252-
MSBuild.exe /m /p:Platform=x64 /p:Configuration=Release external/vpc/vpc.sln
253-
if ERRORLEVEL 1 (
254-
ECHO MSBuild Release x64 for external/vpc/vpc.sln failed.
255-
EXIT /B 1
256-
)
257-
258257
EXIT /B 0

0 commit comments

Comments
 (0)