-
Notifications
You must be signed in to change notification settings - Fork 57
209 lines (179 loc) · 10.8 KB
/
msbuild.yml
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: MSBuild
on:
push:
branches: [ "all-in-one-vs2022-wpo" ]
pull_request:
branches: [ "all-in-one-vs2022-wpo" ]
permissions: write-all
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: src/engine-vs2022.sln
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
DX11: DX11
DX10: DX10
DX9: DX9
DX8: DX8
DX11AVX: DX11-AVX
DX10AVX: DX10-AVX
DX9AVX: DX9-AVX
DX8AVX: DX8-AVX
jobs:
build:
name: build-job
runs-on: windows-latest
strategy:
matrix:
buildconf: ["DX11", "DX10", "DX9", "DX8", "DX11-AVX", "DX10-AVX", "DX9-AVX", "DX8-AVX"]
steps:
- name: Configure Pagefile
# You may pin to the exact commit or the version.
# uses: al-cheb/configure-pagefile-action@86589fd789a4de3e62ba628dda2cb10027b66d67
uses: al-cheb/[email protected]
with:
# Set minimum size of Pagefile
minimum-size: 8GB
# Set maximum size of Pagefile
maximum-size: 8GB
# Set disk root where pagefile.sys will be located
disk-root: "C:"
- name: Checkout repo
uses: actions/checkout@v4
# with:
# ref: all-in-one-vs2022
- name: setup-msbuild
uses: microsoft/[email protected]
with:
# Version of Visual Studio to search; defaults to latest if not specified
# vs-version: '[17.6, 17.7)'
# The preferred processor architecture of MSBuild. Can be either "x86", "x64", or "arm64". "x64" is only available from Visual Studio version 17.0 and later.
msbuild-architecture: "x64"
- name: Add Dependencies
run: |
cd "C:\Program Files (x86)\Microsoft Visual Studio\Installer"
Start-Process -FilePath .\setup.exe -ArgumentList "modify","--add","Microsoft.VisualStudio.Component.VC.ATLMFC","--includeRecommended","--includeOptional","--channelId","VisualStudio.17.Release","--productId","Microsoft.VisualStudio.Product.Enterprise","--quiet","--norestart" -Wait -PassThru
# Start-Process -FilePath .\setup.exe -ArgumentList "modify","--add","Microsoft.VisualStudio.Component.VC.14.36.17.6.x86.x64","--includeRecommended","--includeOptional","--channelId","VisualStudio.17.Release","--productId","Microsoft.VisualStudio.Product.Enterprise","--quiet","--norestart" -Wait -PassThru
# Start-Process -FilePath .\setup.exe -ArgumentList "modify","--add","Microsoft.VisualStudio.Component.VC.14.36.17.6.ATL","--includeRecommended","--includeOptional","--channelId","VisualStudio.17.Release","--productId","Microsoft.VisualStudio.Product.Enterprise","--quiet","--norestart" -Wait -PassThru
# Start-Process -FilePath .\setup.exe -ArgumentList "modify","--add","Microsoft.VisualStudio.Component.VC.14.36.17.6.MFC","--includeRecommended","--includeOptional","--channelId","VisualStudio.17.Release","--productId","Microsoft.VisualStudio.Product.Enterprise","--quiet","--norestart" -Wait -PassThru
# Start-Process -FilePath .\setup.exe -ArgumentList "modify","--add","Microsoft.VisualStudio.Component.Windows10SDK","--includeRecommended","--includeOptional","--channelId","VisualStudio.17.Release","--productId","Microsoft.VisualStudio.Product.Enterprise","--quiet","--norestart" -Wait -PassThru
# Start-Process -FilePath .\setup.exe -ArgumentList "modify","--add","Microsoft.VisualStudio.Component.Windows11SDK.22000","--includeRecommended","--includeOptional","--channelId","VisualStudio.17.Release","--productId","Microsoft.VisualStudio.Product.Enterprise","--quiet","--norestart" -Wait -PassThru
# Start-Process -FilePath .\setup.exe -ArgumentList "modify","--add","Microsoft.VisualStudio.Component.Windows10SDK.20348","--includeRecommended","--includeOptional","--channelId","VisualStudio.17.Release","--productId","Microsoft.VisualStudio.Product.Enterprise","--quiet","--norestart" -Wait -PassThru
# Start-Process -FilePath .\setup.exe -ArgumentList "modify","--add","Microsoft.Component.VC.Runtime.UCRTSDK","--includeRecommended","--includeOptional","--channelId","VisualStudio.17.Release","--productId","Microsoft.VisualStudio.Product.Enterprise","--quiet","--norestart" -Wait -PassThru
# Start-Process -FilePath .\setup.exe -ArgumentList "modify","--add","Microsoft.VisualStudio.Component.VC.ASAN","--includeRecommended","--includeOptional","--channelId","VisualStudio.17.Release","--productId","Microsoft.VisualStudio.Product.Enterprise","--quiet","--norestart" -Wait -PassThru
# Start-Process -FilePath .\setup.exe -ArgumentList "modify","--add","Microsoft.VisualStudio.Component.VC.ATL","--includeRecommended","--includeOptional","--channelId","VisualStudio.17.Release","--productId","Microsoft.VisualStudio.Product.Enterprise","--quiet","--norestart" -Wait -PassThru
# Start-Process -FilePath .\setup.exe -ArgumentList "modify","--add","Microsoft.VisualStudio.Component.VC.Redist.14.Latest","--includeRecommended","--includeOptional","--channelId","VisualStudio.17.Release","--productId","Microsoft.VisualStudio.Product.Enterprise","--quiet","--norestart" -Wait -PassThru
# Start-Process -FilePath .\setup.exe -ArgumentList "modify","--add","Microsoft.VisualStudio.Component.VC.Tools.x86.x64","--includeRecommended","--includeOptional","--channelId","VisualStudio.17.Release","--productId","Microsoft.VisualStudio.Product.Enterprise","--quiet","--norestart" -Wait -PassThru
# Start-Process -FilePath .\setup.exe -ArgumentList "modify","--add","Microsoft.VisualStudio.Component.Vcpkg","--includeRecommended","--includeOptional","--channelId","VisualStudio.17.Release","--productId","Microsoft.VisualStudio.Product.Enterprise","--quiet","--norestart" -Wait -PassThru
# - name: Fake Build ${{matrix.buildconf}}
# working-directory: ${{env.GITHUB_WORKSPACE}}
# run: |
# New-Item -Type Directory -Path "./_build/_game/bin_dbg"
# New-Item -Path "./_build/_game/bin_dbg/${{matrix.buildconf}}.exe"
# New-Item -Path "./_build/_game/bin_dbg/${{matrix.buildconf}}.pdb"
- name: Build ${{matrix.buildconf}}
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /p:Configuration=${{matrix.buildconf}} ${{env.SOLUTION_FILE_PATH}}
- name: Upload Exe
uses: actions/[email protected]
with:
# Artifact name
name: ${{matrix.buildconf}}_exe
# A file, directory or wildcard pattern that describes what to upload
path: ./_build/_game/bin_dbg/*.exe
# The desired behavior if no files are found using the provided path. Available Options:
# warn: Output a warning but do not fail the action
# error: Fail the action with an error message
# ignore: Do not output any warnings or errors, the action does not fail
if-no-files-found: "error"
# Duration after which artifact will expire in days. 0 means using default retention. Minimum 1 day. Maximum 90 days unless changed from the repository settings page.
retention-days: 1
- name: Zip PDB
run: |
cd ./_build/_game/bin_dbg
compress-archive -DestinationPath "STALKER-Anomaly-modded-exes_${{matrix.buildconf}}_pdb.zip" -Path "./*.pdb"
- name: Upload PDB
uses: actions/[email protected]
with:
# Artifact name
name: ${{matrix.buildconf}}_pdb
# A file, directory or wildcard pattern that describes what to upload
path: ./_build/_game/bin_dbg/*.zip
# The desired behavior if no files are found using the provided path. Available Options:
# warn: Output a warning but do not fail the action
# error: Fail the action with an error message
# ignore: Do not output any warnings or errors, the action does not fail
if-no-files-found: "error"
# Duration after which artifact will expire in days. 0 means using default retention. Minimum 1 day. Maximum 90 days unless changed from the repository settings page.
retention-days: 1
release:
needs: build
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# with:
# ref: all-in-one-vs2022
- name: Get Datetime
id: datetime
run: echo "::set-output name=today::$(date +'%-Y.%-m.%-d')"
# Use the output from the `datetime` step
- name: Get Version
run: echo "VERSION ${{steps.datetime.outputs.today}}"
env:
VERSION: "${{steps.datetime.outputs.today}}"
- name: Download artifacts
uses: actions/[email protected]
- name: Zip Exe folder
run: |
mkdir release
mkdir release/bin
cp -a gamedata/. release
mv ${{env.DX11}}_exe/*.exe release/bin
mv ${{env.DX10}}_exe/*.exe release/bin
mv ${{env.DX9}}_exe/*.exe release/bin
mv ${{env.DX8}}_exe/*.exe release/bin
mv ${{env.DX11AVX}}_exe/*.exe release/bin
mv ${{env.DX10AVX}}_exe/*.exe release/bin
mv ${{env.DX9AVX}}_exe/*.exe release/bin
mv ${{env.DX8AVX}}_exe/*.exe release/bin
cd release
zip -r 'STALKER-Anomaly-modded-exes_${{steps.datetime.outputs.today}}.zip' ./*
mv 'STALKER-Anomaly-modded-exes_${{steps.datetime.outputs.today}}.zip' ../
cd ..
env:
RELEASE_NAME_FULL: "${{steps.datetime.outputs.today}}"
- name: Move PDBs to folder
run: |
mkdir pdb
mv ${{env.DX11}}_pdb/*.zip pdb
mv ${{env.DX10}}_pdb/*.zip pdb
mv ${{env.DX9}}_pdb/*.zip pdb
mv ${{env.DX8}}_pdb/*.zip pdb
mv ${{env.DX11AVX}}_pdb/*.zip pdb
mv ${{env.DX10AVX}}_pdb/*.zip pdb
mv ${{env.DX9AVX}}_pdb/*.zip pdb
mv ${{env.DX8AVX}}_pdb/*.zip pdb
- name: Remove artifacts
# You may pin to the exact commit or the version.
# uses: c-hive/gha-remove-artifacts@24dc23384a1fa6a058b79c73727ae0cb2200ca4c
uses: c-hive/[email protected]
with:
# Artifacts older than this will be deleted (e.g. "2 months", "1 day"). Parsed by moment.
age: "1 second"
- name: Publish
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{steps.datetime.outputs.today}}"
title: "${{steps.datetime.outputs.today}}"
prerelease: false
files: |
*.zip
pdb/*.zip