55 push :
66 paths :
77 - ' NetCord.Natives/**'
8+ - ' .github/workflows/build-natives.yml'
9+ tags :
10+ - " [0-9]+.[0-9]+.[0-9]+"
11+ - " [0-9]+.[0-9]+.[0-9]+-*"
812
913jobs :
1014 build-natives :
5761 vcpkg-${{ runner.os }}-${{ matrix.rid }}-
5862 vcpkg-${{ runner.os }}-
5963
60- - name : Setup .NET
61- uses : actions/setup-dotnet@v4
62- with :
63- dotnet-version : 8.0.x
64-
6564 - name : Resolve vcpkg from runner image
6665 shell : pwsh
6766 run : |
@@ -116,21 +115,6 @@ jobs:
116115 path : artifacts
117116 merge-multiple : false
118117
119- - name : Setup .NET
120- uses : actions/setup-dotnet@v4
121- with :
122- dotnet-version : 8.0.x
123-
124- - name : Resolve native license root
125- shell : pwsh
126- run : |
127- $licenseRoot = Get-ChildItem artifacts -Directory | Sort-Object Name | Select-Object -First 1
128- if (-not $licenseRoot) {
129- throw "No native artifact directories were downloaded."
130- }
131-
132- "NativeLicenseRoot=$($licenseRoot.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
133-
134118 - name : Pack combined nupkg
135119 shell : pwsh
136120 run : |
@@ -141,3 +125,20 @@ jobs:
141125 with :
142126 name : NetCord.Natives.Package
143127 path : artifacts/package/*.nupkg
128+
129+ publish :
130+ needs : pack-natives
131+ if : startsWith(github.ref, 'refs/tags/')
132+ runs-on : ubuntu-latest
133+ steps :
134+ - name : Download nupkg
135+ uses : actions/download-artifact@v4
136+ with :
137+ name : NetCord.Natives.Package
138+ path : artifacts/package
139+
140+ - name : Publish Package
141+ env :
142+ KEY : ${{ secrets.NUGET_API_KEY }}
143+ run : |
144+ dotnet nuget push artifacts/package/*.nupkg -k $KEY -s https://api.nuget.org/v3/index.json --skip-duplicate
0 commit comments