Skip to content

Commit 36b979b

Browse files
authored
Merge branch 'main' into cpp_shared_library_loader
2 parents 657f3a4 + 1bb3c01 commit 36b979b

File tree

3 files changed

+69
-44
lines changed

3 files changed

+69
-44
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request:
5+
push: {}
6+
release:
7+
types: [published]
48

59
env:
610
GMODNET_VERSION: '0.6.0'
@@ -13,7 +17,7 @@ jobs:
1317

1418
steps:
1519
- name: Checkout
16-
uses: actions/checkout@v2
20+
uses: actions/checkout@v2.3.4
1721
with:
1822
submodules: 'true'
1923

@@ -82,19 +86,19 @@ jobs:
8286
# Finilize nightly build for push event
8387

8488
- name: Download GMS
85-
if: github.event_name == 'push'
89+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
8690
run: |
8791
wget https://github.com/GlebChili/GmodNetModuleSigner/releases/download/1.0.0/gms
8892
chmod +x gms
8993
9094
- name: Download signature key
91-
if: github.event_name == 'push'
95+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
9296
env:
9397
GITHUB_TOKEN: ${{ secrets.GMOD_NET_PRIVATE_KEY_REPO_TOKEN }}
9498
run: git clone https://GlebChili:[email protected]/GlebChili/GmodDotNetPrivateKey.git
9599

96100
- name: Sign assemblies
97-
if: github.event_name == 'push'
101+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
98102
run: |
99103
cd build
100104
./../gms --sign=gmcl_dotnet_linux64.dll --key=../GmodDotNetPrivateKey/gmodnet-private.modulekey --version=$GMODNET_VERSION
@@ -108,19 +112,19 @@ jobs:
108112
mv gmodnet-public.modulekey GmodNET.modulekey
109113
110114
- name: Pack build
111-
if: github.event_name == 'push'
115+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
112116
env:
113117
TRAVIS_COMMIT: ${{ github.sha }}
114118
run: |
115119
cd build
116120
tar czfv ../linux-$TRAVIS_COMMIT.tar.gz .
117121
118122
- name: Pack with MSBuild
119-
if: github.event_name == 'push'
123+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
120124
run: dotnet build runtime.csproj -target:PackRuntimeBuild
121125

122126
- name: Upload versioned build as artifact
123-
if: github.event_name == 'push'
127+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
124128
uses: actions/[email protected]
125129
with:
126130
name: linux-versioned-build
@@ -132,7 +136,7 @@ jobs:
132136

133137
steps:
134138
- name: Checkout
135-
uses: actions/checkout@v2
139+
uses: actions/checkout@v2.3.4
136140
with:
137141
submodules: 'true'
138142

@@ -165,12 +169,20 @@ jobs:
165169
cp lua/Tests/run_tests.lua gmod/garrysmod/lua/autorun
166170
167171
- name: Run Garry's Mod
168-
shell: bash
172+
shell: pwsh
169173
run: |
170-
powershell -Command './gmod/srcds_win64.exe -console -systemtest -condebug -game "garrysmod" +exec "server.cfg" +gamemode sandbox +map gm_construct +maxplayers 16 +sv_hibernate_think 1'
171-
powershell -Command 'Wait-Process -Name srcds_win64'
174+
./gmod/srcds_win64.exe -console -systemtest -condebug -game "garrysmod" +exec "server.cfg" +gamemode sandbox +map gm_construct +maxplayers 16 +sv_hibernate_think 1
175+
Wait-Process -Name srcds_win64
172176
timeout-minutes: 5
173177
continue-on-error: true
178+
env:
179+
COREHOST_TRACE: 1
180+
COREHOST_TRACE_VERBOSITY: 4
181+
COREHOST_TRACEFILE: corehost_trace.txt
182+
183+
- name: Print Corehost trace
184+
working-directory: ./gmod/
185+
run: cat corehost_trace.txt
174186

175187
- name: Print console log
176188
run: cat gmod/garrysmod/console.log
@@ -192,19 +204,19 @@ jobs:
192204
# Finilize full signed build on push
193205

194206
- name: Download GMS
195-
if: github.event_name == 'push'
207+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
196208
shell: bash
197209
run: curl -O -L https://github.com/GlebChili/GmodNetModuleSigner/releases/download/1.0.0/gms.exe
198210

199211
- name: Download signature key
200-
if: github.event_name == 'push'
212+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
201213
shell: bash
202214
env:
203215
GITHUB_TOKEN: ${{ secrets.GMOD_NET_PRIVATE_KEY_REPO_TOKEN }}
204216
run: git clone https://GlebChili:[email protected]/GlebChili/GmodDotNetPrivateKey.git
205217

206218
- name: Sign assemblies
207-
if: github.event_name == 'push'
219+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
208220
shell: bash
209221
run: |
210222
cd build
@@ -219,11 +231,11 @@ jobs:
219231
mv gmodnet-public.modulekey GmodNET.modulekey
220232
221233
- name: Pack with MSBuild
222-
if: github.event_name == 'push'
234+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
223235
run: dotnet build runtime.csproj -target:PackRuntimeBuild
224236

225237
- name: Upload versioned build as artifact
226-
if: github.event_name == 'push'
238+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
227239
uses: actions/[email protected]
228240
with:
229241
name: windows-versioned-build
@@ -236,7 +248,7 @@ jobs:
236248
steps:
237249

238250
- name: Checkout
239-
uses: actions/checkout@v2
251+
uses: actions/checkout@v2.3.4
240252
with:
241253
submodules: 'true'
242254

@@ -257,19 +269,19 @@ jobs:
257269
# Finilize full signed build on push
258270

259271
- name: Download GMS
260-
if: github.event_name == 'push'
272+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
261273
run: |
262274
curl -O -L https://github.com/GlebChili/GmodNetModuleSigner/releases/download/1.0.0/gms-osx
263275
chmod +x gms-osx
264276
265277
- name: Download signature key
266-
if: github.event_name == 'push'
278+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
267279
env:
268280
GITHUB_TOKEN: ${{ secrets.GMOD_NET_PRIVATE_KEY_REPO_TOKEN }}
269281
run: git clone https://GlebChili:[email protected]/GlebChili/GmodDotNetPrivateKey.git
270282

271283
- name: Sign assemblies
272-
if: github.event_name == 'push'
284+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
273285
run: |
274286
cd build
275287
./../gms-osx --sign=gmcl_dotnet_osx64.dll --key=../GmodDotNetPrivateKey/gmodnet-private.modulekey --version=$GMODNET_VERSION
@@ -283,11 +295,11 @@ jobs:
283295
mv gmodnet-public.modulekey GmodNET.modulekey
284296
285297
- name: Pack with MSBuild
286-
if: github.event_name == 'push'
298+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
287299
run: dotnet build runtime.csproj -target:PackRuntimeBuild
288300

289301
- name: Upload versioned build as artifact
290-
if: github.event_name == 'push'
302+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
291303
uses: actions/[email protected]
292304
with:
293305
name: osx-versioned-build
@@ -299,12 +311,12 @@ jobs:
299311

300312
needs: [linux-build, windows-build, mac-build]
301313

302-
if: github.event_name == 'push'
314+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
303315

304316
steps:
305317

306318
- name: Checkout repository
307-
uses: actions/checkout@v2
319+
uses: actions/checkout@v2.3.4
308320
with:
309321
submodules: 'true'
310322

@@ -359,11 +371,25 @@ jobs:
359371
SOURCE_DIR: 'versioned-publish'
360372
DEST_DIR: 'GmodNETStorage/storage'
361373

362-
- name: Upload API nuget package
374+
- name: Upload API nuget package to Azure DevOps
363375
run: |
364-
dotnet nuget update source gmodnet-packages --username CI --password ${{ secrets.DEVOPS_PASSWORD }} --store-password-in-clear-text
376+
dotnet nuget update source gmodnet-packages --username CI --password ${{ secrets.AZURE_DEVOPS_ARTIFACTS_PAT }} --store-password-in-clear-text
365377
dotnet nuget push nuget-publish/**.nupkg --source gmodnet-packages --api-key az --skip-duplicate
366378
379+
- name: Upload NuGet package to NuGet.org
380+
if: ${{ github.event_name == 'release' }}
381+
run: dotnet nuget push nuget-publish/**.nupkg --source nuget --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
382+
383+
- name: Upload build to GitHub release
384+
if: ${{ github.event_name == 'release' }}
385+
uses: svenstaro/[email protected]
386+
with:
387+
repo_token: ${{ secrets.GITHUB_TOKEN }}
388+
file: versioned-publish/*
389+
overwrite: true
390+
tag: ${{ github.ref }}
391+
file_glob: true
392+
367393
- name: Restore local dotnet tools
368394
run: |
369395
cd csx

gm_dotnet_managed/GmodNET.API/GmodNET.API.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,20 @@
99
<RepositoryType>Git</RepositoryType>
1010
<PackageTags>garrysmod; GmodNET</PackageTags>
1111
<PackageProjectUrl>https://github.com/GmodNET/GmodDotNet</PackageProjectUrl>
12-
<PackageIconUrl>https://raw.githubusercontent.com/GlebChili/GmodDotNet/devel_netcore_2/MetaInfo/Logo/gmodnetlogo.png</PackageIconUrl>
13-
<Company>GmodNET</Company>
14-
<Copyright>Copyright (c) 2018 - 2020 Gleb Krasilich, GmodNET</Copyright>
15-
<Product>$(Description)</Product>
16-
12+
<PackageIcon>gmodnetlogo.png</PackageIcon>
13+
<Company>GmodNET</Company>
14+
<Copyright>Copyright (c) 2018 - 2021 Gleb Krasilich, GmodNET</Copyright>
1715
<PublishRepositoryUrl>true</PublishRepositoryUrl>
18-
<IncludeSymbols>true</IncludeSymbols>
19-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
20-
</PropertyGroup>
21-
22-
<PropertyGroup>
2316
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2417
<DebugType>Portable</DebugType>
2518
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\GmodNET.API.xml</DocumentationFile>
2619
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
20+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
21+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
22+
</PropertyGroup>
23+
24+
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
25+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
2726
</PropertyGroup>
2827

2928
<ItemGroup>
@@ -36,6 +35,7 @@
3635

3736
<ItemGroup>
3837
<VersionFile Include="../../version.json" />
38+
<Content Include="../../MetaInfo/Logo/gmodnetlogo.png" PackagePath="/" />
3939
</ItemGroup>
4040

4141
</Project>

gm_dotnet_managed/GmodNET/GmodNET.csproj

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,16 @@
1010
<RepositoryType>Git</RepositoryType>
1111
<Company>GmodNET</Company>
1212
<Product>$(Description)</Product>
13-
<Copyright>Copyright (c) 2018 - 2020 Gleb Krasilich, GmodNET</Copyright>
14-
13+
<Copyright>Copyright (c) 2018 - 2021 Gleb Krasilich, GmodNET</Copyright>
1514
<PublishRepositoryUrl>true</PublishRepositoryUrl>
16-
<IncludeSymbols>true</IncludeSymbols>
17-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
18-
</PropertyGroup>
19-
20-
<PropertyGroup>
2115
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2216
<DebugType>Portable</DebugType>
2317
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
18+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
19+
</PropertyGroup>
20+
21+
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
22+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
2423
</PropertyGroup>
2524

2625
<ItemGroup>

0 commit comments

Comments
 (0)