-
-
Notifications
You must be signed in to change notification settings - Fork 8
512 lines (512 loc) · 27.8 KB
/
release.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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
on:
push:
tags:
- '*.*.*'
- '*.*.*-*.*'
jobs:
fetch-nethost-linux:
runs-on: ubuntu-22.04
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup .NET Core
shell: pwsh
run: |
.\download_dotnet.ps1 ${{ runner.temp }} linux
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: nethost-linux
path: ${{ runner.temp }}/libnethost.tar
fetch-nethost-windows:
runs-on: windows-2022
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup .NET Core
shell: pwsh
run: |
.\download_dotnet.ps1 ${{ runner.temp }} win
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: nethost-windows
path: ${{ runner.temp }}\libnethost.tar
build-api:
runs-on: ubuntu-latest
needs: [fetch-nethost-linux, fetch-nethost-windows]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- id: build_info
run: |
branch=$(git ls-remote --heads origin | grep $GITHUB_SHA | sed "s/.*\///")
branch=$(([[ $branch == 'release' ]] && echo "release") || ([[ $branch == 'rc' ]] && echo "rc") || ([[ $branch == 'dev' ]] && echo "dev") || echo "$branch")
version=${GITHUB_REF##*/}
echo "branch=$branch" >> $GITHUB_OUTPUT
echo "version=$version" >> $GITHUB_OUTPUT
- name: Replace package versions
run: |
echo "$(echo "`cat ./api/AltV.Net/AltV.Net.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./api/AltV.Net/AltV.Net.csproj
echo "$(echo "`cat ./api/AltV.Net/AltV.Net.csproj`" | perl -pe 's/<PackageReleaseNotes>(.*)<\/PackageReleaseNotes>/<PackageReleaseNotes>Changelog can be found here https:\/\/github.com\/FabianTerhorst\/coreclr-module\/releases\/tag\/'${GITHUB_REF##*/}'<\/PackageReleaseNotes>/g')" > ./api/AltV.Net/AltV.Net.csproj
echo "$(echo "`cat ./api/AltV.Net.Async/AltV.Net.Async.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./api/AltV.Net.Async/AltV.Net.Async.csproj
echo "$(echo "`cat ./api/AltV.Net.Async/AltV.Net.Async.csproj`" | perl -pe 's/<PackageReleaseNotes>(.*)<\/PackageReleaseNotes>/<PackageReleaseNotes>Changelog can be found here https:\/\/github.com\/FabianTerhorst\/coreclr-module\/releases\/tag\/'${GITHUB_REF##*/}'<\/PackageReleaseNotes>/g')" > ./api/AltV.Net.Async/AltV.Net.Async.csproj
echo "$(echo "`cat ./api/AltV.Net.Interactions/AltV.Net.Interactions.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./api/AltV.Net.Interactions/AltV.Net.Interactions.csproj
echo "$(echo "`cat ./api/AltV.Net.Interactions/AltV.Net.Interactions.csproj`" | perl -pe 's/<PackageReleaseNotes>(.*)<\/PackageReleaseNotes>/<PackageReleaseNotes>Changelog can be found here https:\/\/github.com\/FabianTerhorst\/coreclr-module\/releases\/tag\/'${GITHUB_REF##*/}'<\/PackageReleaseNotes>/g')" > ./api/AltV.Net.Interactions/AltV.Net.Interactions.csproj
echo "$(echo "`cat ./api/AltV.Net.Async.CodeGen/AltV.Net.Async.CodeGen.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./api/AltV.Net.Async.CodeGen/AltV.Net.Async.CodeGen.csproj
echo "$(echo "`cat ./api/AltV.Net.Async.CodeGen/AltV.Net.Async.CodeGen.csproj`" | perl -pe 's/<PackageReleaseNotes>(.*)<\/PackageReleaseNotes>/<PackageReleaseNotes>Changelog can be found here https:\/\/github.com\/FabianTerhorst\/coreclr-module\/releases\/tag\/'${GITHUB_REF##*/}'<\/PackageReleaseNotes>/g')" > ./api/AltV.Net.Async.CodeGen/AltV.Net.Async.CodeGen.csproj
echo "$(echo "`cat ./api/AltV.Net.Resources.Chat.Api/AltV.Net.Resources.Chat.Api.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./api/AltV.Net.Resources.Chat.Api/AltV.Net.Resources.Chat.Api.csproj
echo "$(echo "`cat ./api/AltV.Net.Resources.Chat.Api/AltV.Net.Resources.Chat.Api.csproj`" | perl -pe 's/<PackageReleaseNotes>(.*)<\/PackageReleaseNotes>/<PackageReleaseNotes>Changelog can be found here https:\/\/github.com\/FabianTerhorst\/coreclr-module\/releases\/tag\/'${GITHUB_REF##*/}'<\/PackageReleaseNotes>/g')" > ./api/AltV.Net.Resources.Chat.Api/AltV.Net.Resources.Chat.Api.csproj
echo "$(echo "`cat ./api/AltV.Net.EntitySync.ServerEvent/AltV.Net.EntitySync.ServerEvent.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./api/AltV.Net.EntitySync.ServerEvent/AltV.Net.EntitySync.ServerEvent.csproj
echo "$(echo "`cat ./api/AltV.Net.EntitySync.ServerEvent/AltV.Net.EntitySync.ServerEvent.csproj`" | perl -pe 's/<PackageReleaseNotes>(.*)<\/PackageReleaseNotes>/<PackageReleaseNotes>Changelog can be found here https:\/\/github.com\/FabianTerhorst\/coreclr-module\/releases\/tag\/'${GITHUB_REF##*/}'<\/PackageReleaseNotes>/g')" > ./api/AltV.Net.EntitySync.ServerEvent/AltV.Net.EntitySync.ServerEvent.csproj
echo "$(echo "`cat ./api/AltV.Net.Client/AltV.Net.Client.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./api/AltV.Net.Client/AltV.Net.Client.csproj
echo "$(echo "`cat ./api/AltV.Net.Client/AltV.Net.Client.csproj`" | perl -pe 's/<PackageReleaseNotes>(.*)<\/PackageReleaseNotes>/<PackageReleaseNotes>Changelog can be found here https:\/\/github.com\/FabianTerhorst\/coreclr-module\/releases\/tag\/'${GITHUB_REF##*/}'<\/PackageReleaseNotes>/g')" > ./api/AltV.Net.Client/AltV.Net.Client.csproj
echo "$(echo "`cat ./api/AltV.Net.Client.Async/AltV.Net.Client.Async.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./api/AltV.Net.Client.Async/AltV.Net.Client.Async.csproj
echo "$(echo "`cat ./api/AltV.Net.Client.Async/AltV.Net.Client.Async.csproj`" | perl -pe 's/<PackageReleaseNotes>(.*)<\/PackageReleaseNotes>/<PackageReleaseNotes>Changelog can be found here https:\/\/github.com\/FabianTerhorst\/coreclr-module\/releases\/tag\/'${GITHUB_REF##*/}'<\/PackageReleaseNotes>/g')" > ./api/AltV.Net.Client.Async/AltV.Net.Client.Async.csproj
echo "$(echo "`cat ./api/AltV.Net.ColShape/AltV.Net.ColShape.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./api/AltV.Net.ColShape/AltV.Net.ColShape.csproj
echo "$(echo "`cat ./api/AltV.Net.ColShape/AltV.Net.ColShape.csproj`" | perl -pe 's/<PackageReleaseNotes>(.*)<\/PackageReleaseNotes>/<PackageReleaseNotes>Changelog can be found here https:\/\/github.com\/FabianTerhorst\/coreclr-module\/releases\/tag\/'${GITHUB_REF##*/}'<\/PackageReleaseNotes>/g')" > ./api/AltV.Net.ColShape/AltV.Net.ColShape.csproj
echo "$(echo "`cat ./api/AltV.Net.CApi/AltV.Net.CApi.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./api/AltV.Net.CApi/AltV.Net.CApi.csproj
echo "$(echo "`cat ./api/AltV.Net.CApi/AltV.Net.CApi.csproj`" | perl -pe 's/<PackageReleaseNotes>(.*)<\/PackageReleaseNotes>/<PackageReleaseNotes>Changelog can be found here https:\/\/github.com\/FabianTerhorst\/coreclr-module\/releases\/tag\/'${GITHUB_REF##*/}'<\/PackageReleaseNotes>/g')" > ./api/AltV.Net.CApi/AltV.Net.CApi.csproj
echo "$(echo "`cat ./api/AltV.Net.Shared/AltV.Net.Shared.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./api/AltV.Net.Shared/AltV.Net.Shared.csproj
echo "$(echo "`cat ./api/AltV.Net.Shared/AltV.Net.Shared.csproj`" | perl -pe 's/<PackageReleaseNotes>(.*)<\/PackageReleaseNotes>/<PackageReleaseNotes>Changelog can be found here https:\/\/github.com\/FabianTerhorst\/coreclr-module\/releases\/tag\/'${GITHUB_REF##*/}'<\/PackageReleaseNotes>/g')" > ./api/AltV.Net.Shared/AltV.Net.Shared.csproj
echo "$(echo "`cat ./api/AltV.Net.Sdk.Server/Sdk/Sdk.targets`" | perl -pe 's/Version=\"1.0.0\"/Version=\"'${GITHUB_REF##*/}'\"/g')" > ./api/AltV.Net.Sdk.Server/Sdk/Sdk.targets
echo "$(echo "`cat ./api/AltV.Net.Sdk.Client/Sdk/Sdk.targets`" | perl -pe 's/Version=\"1.0.0\"/Version=\"'${GITHUB_REF##*/}'\"/g')" > ./api/AltV.Net.Sdk.Client/Sdk/Sdk.targets
echo "$(echo "`cat ./api/AltV.Net.Sdk.Shared/Sdk/Sdk.targets`" | perl -pe 's/Version=\"1.0.0\"/Version=\"'${GITHUB_REF##*/}'\"/g')" > ./api/AltV.Net.Sdk.Shared/Sdk/Sdk.targets
echo "$(echo "`cat ./api/AltV.Net.Sdk.Server/AltV.Net.Sdk.Server.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./api/AltV.Net.Sdk.Server/AltV.Net.Sdk.Server.csproj
echo "$(echo "`cat ./api/AltV.Net.Sdk.Client/AltV.Net.Sdk.Client.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./api/AltV.Net.Sdk.Client/AltV.Net.Sdk.Client.csproj
echo "$(echo "`cat ./api/AltV.Net.Sdk.Shared/AltV.Net.Sdk.Shared.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./api/AltV.Net.Sdk.Shared/AltV.Net.Sdk.Shared.csproj
echo "$(echo "`cat ./templates/AltV.Net.Templates.csproj`" | perl -pe 's/<PackageVersion>(.*)<\/PackageVersion>/<PackageVersion>'${GITHUB_REF##*/}'<\/PackageVersion>/g')" > ./templates/AltV.Net.Templates.csproj
echo "$(echo "`cat ./templates/templates/altv-resource/.template.config/template.json`" | perl -pe 's/0.0.0/'${GITHUB_REF##*/}'/g')" > ./templates/templates/altv-resource/.template.config/template.json
echo "$(echo "`cat ./templates/templates/altv-project-client/.template.config/template.json`" | perl -pe 's/0.0.0/'${GITHUB_REF##*/}'/g')" > ./templates/templates/altv-project-client/.template.config/template.json
echo "$(echo "`cat ./templates/templates/altv-project-server/.template.config/template.json`" | perl -pe 's/0.0.0/'${GITHUB_REF##*/}'/g')" > ./templates/templates/altv-project-server/.template.config/template.json
echo "$(echo "`cat ./templates/templates/altv-project-shared/.template.config/template.json`" | perl -pe 's/0.0.0/'${GITHUB_REF##*/}'/g')" > ./templates/templates/altv-project-shared/.template.config/template.json
- name: Execute CodeGen
working-directory: ./api/AltV.Net.Sdk.Generator
run: dotnet run
- name: Build
working-directory: ./api
run: |
dotnet publish AltV.Net.Host -c Release -f net6.0
dotnet publish AltV.Net.Host -c Release -f net6.0
dotnet publish AltV.Net.Shared -c Release -f net6.0
dotnet publish AltV.Net.CApi -c Release -f net6.0
dotnet publish AltV.Net -c Release -f net6.0
dotnet publish AltV.Net -c Debug -f net6.0
dotnet publish AltV.Net.Async -c Release -f net6.0
dotnet publish AltV.Net.Async -c Debug -f net6.0
dotnet publish AltV.Net.Interactions -c Release -f net6.0
dotnet publish AltV.Net.Async.CodeGen -c Release -f netstandard2.0
dotnet publish AltV.Net.Resources.Chat.Api -c Release -f net6.0
dotnet publish AltV.Net.EntitySync.ServerEvent -c Release -f net6.0
dotnet publish AltV.Net.Client -c Release -f net6.0
dotnet publish AltV.Net.Client.Async -c Release -f net6.0
dotnet publish AltV.Net.ColShape -c Release -f net6.0
dotnet publish AltV.Net.Sdk.Server -c Release -f net6.0
dotnet publish AltV.Net.Sdk.Client -c Release -f net6.0
dotnet publish AltV.Net.Sdk.Shared -c Release -f net6.0
- run: |
mkdir -p ./modules/linux
mkdir -p ./modules/windows
mkdir -p ./modules/api-release
mkdir -p ./modules/api-debug
cp ./api/AltV.Net.Host/bin/Release/*/publish/AltV.Net.Host.dll ./modules/linux
cp ./api/AltV.Net.Host/bin/Release/*/publish/AltV.Net.Host.runtimeconfig.json ./modules/linux
cp ./api/AltV.Net.Host/bin/Release/*/publish/AltV.Net.Host.dll ./modules/windows
cp ./api/AltV.Net.Host/bin/Release/*/publish/AltV.Net.Host.runtimeconfig.json ./modules/windows
cp ./api/AltV.Net/bin/Release/*/publish/AltV.Net.dll ./modules/api-release
cp ./api/AltV.Net/bin/Release/*/publish/AltV.Net.pdb ./modules/api-release
cp ./api/AltV.Net.Async/bin/Release/*/publish/AltV.Net.Async.dll ./modules/api-release
cp ./api/AltV.Net.Async/bin/Release/*/publish/AltV.Net.Async.pdb ./modules/api-release
cp ./api/AltV.Net/bin/Debug/*/publish/AltV.Net.dll ./modules/api-debug
cp ./api/AltV.Net/bin/Debug/*/publish/AltV.Net.pdb ./modules/api-debug
cp ./api/AltV.Net.Async/bin/Debug/*/publish/AltV.Net.Async.dll ./modules/api-debug
cp ./api/AltV.Net.Async/bin/Debug/*/publish/AltV.Net.Async.pdb ./modules/api-debug
echo '${{ steps.build_info.outputs.branch }}/${{ steps.build_info.outputs.version }}' > ./modules/build_info.txt
- run: |
cd ./runtime
echo "$(git rev-parse --short HEAD)" > ../modules/runtime_version.txt
cd ./cpp-sdk
echo "$(git rev-parse --short HEAD)" > ../../modules/sdk_version.txt
- name: Pack files module
run: |
tar -cvf ./modules.tar modules
- name: Pack files api
run: |
tar -cvf ./api.tar api
- name: Pack files templates
run: |
tar -cvf ./templates.tar templates
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: csharp-module-modules
path: ./modules.tar
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: csharp-module-api
path: ./api.tar
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: csharp-module-templates
path: ./templates.tar
build-server:
runs-on: ${{ matrix.config.os }}
needs: [fetch-nethost-linux, fetch-nethost-windows]
strategy:
matrix:
config:
- {
name: linux,
os: ubuntu-20.04,
cc: gcc-9,
cxx: g++-9,
args: -DCMAKE_BUILD_TYPE=RelWithDebInfo,
nethost: nethost-linux,
}
- {
name: windows,
os: windows-latest,
cc: cl,
cxx: cl,
args: -DCMAKE_BUILD_TYPE=RelWithDebInfo -A x64 -T host=x64,
nethost: nethost-windows,
}
#- {
# name: linux-arm,
# os: ubuntu-latest,
# cc: aarch64-linux-gnu-gcc-8,
# cxx: aarch64-linux-gnu-g++-8,
# args: -DCMAKE_BUILD_TYPE=RelWithDebInfo,
# nethost: nethost-linux-arm,
# }
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/download-artifact@v3
with:
name: ${{ matrix.config.nethost }}
path: ./runtime/nethost
- working-directory: ./runtime/nethost
shell: bash
run: |
tar xvf libnethost.tar
ls -l
pwd
- working-directory: ./runtime/server
shell: cmake -P {0}
run: |
set(ENV{CC} ${{ matrix.config.cc }})
set(ENV{CXX} ${{ matrix.config.cxx }})
file(MAKE_DIRECTORY build)
execute_process(
COMMAND cmake .. ${{ matrix.config.args }}
RESULT_VARIABLE result
WORKING_DIRECTORY build
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Bad exit status")
endif()
- working-directory: ./runtime/server
shell: bash
run: cmake --build build --config RelWithDebInfo
- if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
mkdir -p modules/linux/modules/
cp ./runtime/server/build/src/libcsharp-module.so ./modules/linux/modules
- if: ${{ runner.os == 'Windows' }}
shell: bash
run: |
mkdir -p modules/windows/modules/
cp ./runtime/server/build/src/RelWithDebInfo/csharp-module.dll ./modules/windows/modules
cp ./runtime/server/build/src/RelWithDebInfo/csharp-module.pdb ./modules/windows/modules
- id: create_archive
shell: bash
run: |
filename=$(echo "${{ matrix.config.name }}")
tar -cvf ./$filename.tar modules/$filename/modules
echo "art_name=$filename" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
with:
name: csharp-module-${{ matrix.config.name }}
path: ./${{ steps.create_archive.outputs.art_name }}.tar
deploy-cdn:
runs-on: ubuntu-latest
needs: [build-api, build-server]
steps:
- uses: actions/download-artifact@v3
with:
name: csharp-module-modules
path: ./
- uses: actions/download-artifact@v3
with:
name: csharp-module-linux
path: ./
- uses: actions/download-artifact@v3
with:
name: csharp-module-windows
path: ./
- run: |
tar -xvf ./modules.tar
tar -xvf ./linux.tar
tar -xvf ./windows.tar
- id: build_info
run: |
build_info=$(cat ./modules/build_info.txt)
echo "branch=${build_info%%/*}" >> $GITHUB_OUTPUT
echo "version=${build_info##*/}" >> $GITHUB_OUTPUT
echo "sdk_commit=$(cat ./modules/sdk_version.txt)" >> $GITHUB_OUTPUT
- run: npm i @altmp/upload-tool@latest [email protected]
- run: npx alt-upload linux coreclr-module/$BRANCH/x64_linux $VERSION $SDK_VERSION
working-directory: ./modules
env:
AWS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
AWS_ENDPOINT: ${{ secrets.AWS_ENDPOINT }}
CF_CACHE_PURGE_TOKEN: ${{ secrets.CF_CACHE_PURGE_TOKEN }}
CF_CACHE_ZONE_ID: ${{ secrets.CF_CACHE_ZONE_ID }}
CF_CACHE_PURGE_URL: ${{ secrets.CF_CACHE_PURGE_URL }}
BRANCH: ${{ steps.build_info.outputs.branch }}
VERSION: ${{ steps.build_info.outputs.version }}
SDK_VERSION: ${{ steps.build_info.outputs.sdk_commit }}
- run: npx alt-upload windows coreclr-module/$BRANCH/x64_win32 $VERSION $SDK_VERSION
working-directory: ./modules
env:
AWS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
AWS_ENDPOINT: ${{ secrets.AWS_ENDPOINT }}
CF_CACHE_PURGE_TOKEN: ${{ secrets.CF_CACHE_PURGE_TOKEN }}
CF_CACHE_ZONE_ID: ${{ secrets.CF_CACHE_ZONE_ID }}
CF_CACHE_PURGE_URL: ${{ secrets.CF_CACHE_PURGE_URL }}
BRANCH: ${{ steps.build_info.outputs.branch }}
VERSION: ${{ steps.build_info.outputs.version }}
SDK_VERSION: ${{ steps.build_info.outputs.sdk_commit }}
deploy-nuget:
runs-on: ubuntu-latest
needs: [build-api, build-server]
steps:
- uses: actions/download-artifact@v3
with:
name: csharp-module-api
path: ./
- uses: actions/download-artifact@v3
with:
name: csharp-module-templates
path: ./
- run: |
tar -xvf ./api.tar
tar -xvf ./templates.tar
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./api/AltV.Net/AltV.Net.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./api/AltV.Net.Async/AltV.Net.Async.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./api/AltV.Net.Interactions/AltV.Net.Interactions.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./api/AltV.Net.Async.CodeGen/AltV.Net.Async.CodeGen.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./api/AltV.Net.Resources.Chat.Api/AltV.Net.Resources.Chat.Api.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./api/AltV.Net.EntitySync.ServerEvent/AltV.Net.EntitySync.ServerEvent.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./api/AltV.Net.Client/AltV.Net.Client.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./api/AltV.Net.Client.Async/AltV.Net.Client.Async.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./api/AltV.Net.ColShape/AltV.Net.ColShape.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./api/AltV.Net.Shared/AltV.Net.Shared.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./api/AltV.Net.CApi/AltV.Net.CApi.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./api/AltV.Net.Sdk.Client/AltV.Net.Sdk.Client.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./api/AltV.Net.Sdk.Server/AltV.Net.Sdk.Server.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./api/AltV.Net.Sdk.Shared/AltV.Net.Sdk.Shared.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
- uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: ./templates/AltV.Net.Templates.csproj
VERSION_REGEX: <PackageVersion>(.*)<\/PackageVersion>
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
INCLUDE_SYMBOLS: true
TAG_COMMIT: false
NO_BUILD: true
build-docker:
name: Trigger Docker image build
runs-on: ubuntu-latest
needs: [deploy-cdn]
steps:
- name: Get Token
id: get_workflow_token
uses: peter-murray/workflow-application-token-action@v2
with:
application_id: ${{ secrets.CI_APP_ID }}
application_private_key: ${{ secrets.CI_APP_PRIVATE_KEY }}
permissions: "actions:write"
organization: altmp
- name: Trigger Docker build
uses: benc-uk/workflow-dispatch@v1
with:
workflow: build.yml
ref: main
repo: altmp/altv-docker
token: ${{ steps.get_workflow_token.outputs.token }}
create-release:
runs-on: ubuntu-latest
needs: [deploy-cdn, deploy-nuget]
steps:
- uses: actions/download-artifact@v3
with:
name: csharp-module-modules
path: ./
- uses: actions/download-artifact@v3
with:
name: csharp-module-linux
path: ./
- uses: actions/download-artifact@v3
with:
name: csharp-module-windows
path: ./
- run: |
tar -xvf ./modules.tar
tar -xvf ./linux.tar
tar -xvf ./windows.tar
- id: build_info
run: |
build_info=$(cat ./modules/build_info.txt)
echo "branch=${build_info%%/*}" >> $GITHUB_OUTPUT
echo "version=${build_info##*/}" >> $GITHUB_OUTPUT
echo "runtime_commit=$(cat ./modules/runtime_version.txt)" >> $GITHUB_OUTPUT
echo "sdk_commit=$(cat ./modules/sdk_version.txt)" >> $GITHUB_OUTPUT
- run: |
(cd ./modules/linux && zip -r ../../csharp-module-linux.zip *)
(cd ./modules/windows && zip -r ../../csharp-module-win.zip *)
(cd ./modules/api-release && zip -r ../../csharp-module-modules-release.zip *)
(cd ./modules/api-debug && zip -r ../../csharp-module-modules-debug.zip *)
- id: create_release
uses: softprops/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.build_info.outputs.version }}
name: Version ${{ steps.build_info.outputs.version }}
prerelease: ${{ steps.build_info.outputs.branch != 'release' }}
generate_release_notes: true
body: |
Runtime version: [${{ steps.build_info.outputs.runtime_commit }}](https://github.com/altmp/coreclr-module-runtime/commit/${{ steps.build_info.outputs.runtime_commit }})
SDK version: [${{ steps.build_info.outputs.sdk_commit }}](https://github.com/altmp/cpp-sdk/commit/${{ steps.build_info.outputs.sdk_commit }})
files: |
./csharp-module-linux.zip
./csharp-module-win.zip
./csharp-module-modules-release.zip
./csharp-module-modules-debug.zip
cleanup:
runs-on: ubuntu-latest
needs: create-release
if: ${{ always() }}
steps:
- uses: geekyeggo/delete-artifact@v2
with:
name: |
nethost-linux
nethost-windows
csharp-module-linux
csharp-module-windows
csharp-module-modules
csharp-module-api
csharp-module-templates