-
Notifications
You must be signed in to change notification settings - Fork 496
189 lines (146 loc) · 5.46 KB
/
steamkit2-build.yaml
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
name: CI/CD
on:
push:
branches: [ master, gh-actions ]
pull_request:
branches: [ master ]
jobs:
steamkit2:
name: SteamKit2 on ${{ matrix.os }} - ${{ matrix.configuration }} (SDK ${{ matrix.sdk }})
strategy:
matrix:
os: [ windows-latest, macos-latest, macos-14, ubuntu-latest ]
sdk: [ 8.0.x ]
configuration: [ Debug, Release ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.sdk }}
- name: Build SteamKit2
run: dotnet build --configuration ${{ matrix.configuration }} SteamKit2/SteamKit2/SteamKit2.csproj
- name: Build SteamLanguageParser
run: dotnet build --configuration ${{ matrix.configuration }} Resources/SteamLanguageParser/SteamLanguageParser.csproj
- name: Build ProtobufGen
run: dotnet build --configuration ${{ matrix.configuration }} Resources/ProtobufGen/ProtobufGen.sln
- name: Build ProtobufDumper
run: dotnet build --configuration ${{ matrix.configuration }} Resources/ProtobufDumper/ProtobufDumper.sln
- name: Build Samples
run: dotnet build --configuration ${{ matrix.configuration }} Samples/Samples.sln
- name: Build NetHookAnalyzer2
run: dotnet build --configuration ${{ matrix.configuration }} Resources/NetHookAnalyzer2/NetHookAnalyzer2.sln
if: matrix.os == 'windows-latest'
- name: Run Tests
run: >
dotnet test
--configuration ${{ matrix.configuration }}
--verbosity normal
SteamKit2/Tests/Tests.csproj
/p:CollectCoverage=true
/p:CoverletOutputFormat=lcov
/p:CoverletOutput='./Coverage/lcov.info'
/p:Include="[SteamKit2]SteamKit*"
/p:Exclude="[SteamKit2]SteamKit2*Internal*"
- name: Upload test coverage
uses: codecov/codecov-action@v4
if: matrix.configuration == 'Debug'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./SteamKit2/Tests/Coverage/lcov.info
fail_ci_if_error: false
verbose: true
steamkit2-artifacts:
name: Create NuGet Package
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Create NuGet Package
run: dotnet pack --configuration Release SteamKit2/SteamKit2/SteamKit2.csproj
- name: Upload NuGet Package
uses: actions/upload-artifact@v4
with:
name: SteamKit2.nupkg
path: 'SteamKit2/SteamKit2/bin/Release/*.nupkg'
nha2-artifacts:
name: Create NetHookAnalyzer2 Release
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Publish NetHookAnalyzer2
run: dotnet publish --configuration Release --runtime win-x64 --self-contained Resources/NetHookAnalyzer2/NetHookAnalyzer2/NetHookAnalyzer2.csproj /p:PublishSingleFile=True
- name: Upload NetHookAnalyzer2
uses: actions/upload-artifact@v4
with:
name: NetHookAnalyzer2
path: 'Resources/NetHookAnalyzer2/NetHookAnalyzer2/bin/Release/win-x64/publish/*'
nethook2:
name: NetHook2 - ${{ matrix.platform }} - ${{ matrix.configuration }}
permissions:
contents: write
strategy:
matrix:
configuration: [ Debug, Release ]
platform: [ Win32, x64 ]
fail-fast: false
runs-on: windows-2022
# https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Add cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Configure Dependencies
run: pwsh -File Resources/NetHook2/SetupDependencies.ps1
- name: Build NetHook2
run: msbuild /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} Resources/NetHook2/NetHook2.sln
- name: Upload NetHook2
uses: actions/upload-artifact@v4
if: matrix.configuration == 'Release'
with:
name: NetHook2-${{ matrix.platform }}
path: 'Resources/NetHook2/${{ matrix.platform }}/${{ matrix.configuration }}/*.dll'
gh-packages:
name: Publish to GitHub Packages
if: github.event_name != 'pull_request'
permissions:
packages: write
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Create NuGet Package
run: dotnet pack --configuration Release SteamKit2/SteamKit2/SteamKit2.csproj
- name: Publish NuGet Package to GitHub Packages
run: |
dotnet nuget push SteamKit2\SteamKit2\bin\Release\SteamKit2.*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/SteamRE/index.json