-
Notifications
You must be signed in to change notification settings - Fork 497
168 lines (127 loc) · 4.77 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
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, ubuntu-latest ]
sdk: [ 6.0.x ]
configuration: [ Debug, Release ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
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
if: matrix.configuration == 'Debug'
run: dotnet test --verbosity normal --framework net6.0 SteamKit2/Tests/Tests.csproj
- name: Run Tests (.NET Framework)
if: matrix.configuration == 'Debug' && startsWith(matrix.os, 'windows-')
run: dotnet test --verbosity normal --framework net48 SteamKit2/Tests/Tests.csproj
steamkit2-artifacts:
name: Create NuGet Package
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Create NuGet Package
run: dotnet pack --configuration Release SteamKit2/SteamKit2/SteamKit2.csproj
- name: Upload NuGet Package
uses: actions/upload-artifact@v3
with:
name: SteamKit2.nupkg
path: 'SteamKit2/SteamKit2/bin/Release/*.nupkg'
nha2-artifacts:
name: Create NetHookAnalyzer2 Release
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.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@v3
with:
name: NetHookAnalyzer2
path: 'Resources/NetHookAnalyzer2/NetHookAnalyzer2/bin/Release/win-x64/publish/*'
nethook2:
name: NetHook2 - ${{ matrix.configuration }}
strategy:
matrix:
configuration: [ Debug, Release ]
fail-fast: false
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Cache vcpkg
id: cache-dependencies
uses: actions/cache@v3
with:
path: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\vcpkg
key: vcpkg-${{ hashFiles('Resources/NetHook2/NetHook2/vcpkg.json') }}
- name: Configure Dependencies
run: pwsh -File Resources/NetHook2/SetupDependencies.ps1
- name: Build NetHook2
run: msbuild /p:Configuration=${{ matrix.configuration }} Resources/NetHook2/NetHook2.sln
- name: Upload NetHook2
uses: actions/upload-artifact@v3
if: matrix.configuration == 'Release'
with:
name: NetHook2
path: 'Resources/NetHook2/Release/*.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@v3
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.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