-
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (56 loc) · 2.22 KB
/
artifact.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
name: Build and Publish Artifact
on:
- push
env:
EXILED_REFERENCES_URL: https://misaka-zerotwo.github.io/SL-References/Dev.zip
XP_SYSTEM_URL: https://api.github.com/repos/RowpannSCP/XP/releases
EXILED_REFERENCES: ${{ github.workspace }}/refs
jobs:
build:
runs-on: windows-2019
steps:
- name: Setup MSBuild
uses: microsoft/[email protected]
with:
vs-prerelease: false
msbuild-architecture: x64
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Checkout
uses: actions/checkout@v4
- name: Get Exiled References
shell: pwsh
run: |
Invoke-WebRequest -Uri ${{ env.EXILED_REFERENCES_URL }} -OutFile ${{ github.workspace }}/References.zip
Expand-Archive -Path References.zip -DestinationPath ${{ env.EXILED_REFERENCES }} -Force
- name: Get XP System
shell: pwsh
run: |
$response = Invoke-RestMethod -Uri ${{ env.XP_SYSTEM_URL }}
$asset = $response.assets | Where-Object { $_.name -eq 'XPSystem-EXILED.dll' } | Select-Object -First 1
$url = $asset.browser_download_url
Invoke-WebRequest -Uri $url -OutFile ${{ env.EXILED_REFERENCES }}/XPSystem.dll
- name: Restore packages
run: nuget restore ${{ github.workspace }}/DiscordLab.sln
- name: Build
run: msbuild.exe ${{ github.workspace }}/DiscordLab.sln /p:Configuration=Debug /p:Platform="Any CPU"
- name: Move DLLs to single directory
shell: pwsh
run: |
$outputDir = "${{ github.workspace }}/output"
if (-Not (Test-Path -Path $outputDir)) {
New-Item -ItemType Directory -Path $outputDir
}
Get-ChildItem -Path ${{ github.workspace }} -Directory | ForEach-Object {
$folderName = $_.Name
$dllPath = Join-Path -Path $_.FullName -ChildPath "bin/Debug/net48/$folderName.dll"
if (Test-Path -Path $dllPath) {
Copy-Item -Path $dllPath -Destination $outputDir
}
}
- name: Publish Artifact
uses: actions/upload-artifact@v4
with:
name: DiscordLab
path: ${{ github.workspace }}/output
if-no-files-found: error