1414 GH_TOKEN : ${{ secrets.GH_TOKEN }}
1515 MSBUILDTERMINALLOGGER : auto
1616 SLEET_FEED_URL : https://api.nuget.org/v3/index.json
17-
18- defaults :
19- run :
20- shell : pwsh
21-
17+
2218jobs :
23- native-aot :
24- name : native-aot-${{ matrix.rid }}
25- runs-on : ${{ matrix.os }}
26- strategy :
27- fail-fast : false
28- matrix :
29- include :
30- - os : ubuntu-latest
31- rid : linux-x64
32- - os : ubuntu-24.04-arm
33- rid : linux-arm64
34- - os : windows-latest
35- rid : win-x64
36- - os : windows-11-arm
37- rid : win-arm64
38- - os : macos-15-intel
39- rid : osx-x64
40- - os : macos-latest
41- rid : osx-arm64
42- steps :
43- - name : 🤘 checkout
44- uses : actions/checkout@v4
45-
46- - name : ⚙ dotnet
47- uses : devlooped/actions-dotnet-env@v1
48-
49- - name : 📦 pack
50- run : |
51- dotnet pack src/go/go.csproj -c $env:Configuration -r ${{ matrix.rid }} -bl:"pack-${{ matrix.rid }}.binlog"
52-
53- - name : 📤 package
54- uses : actions/upload-artifact@v4
55- with :
56- name : package-${{ matrix.rid }}
57- path : bin/*.${{ matrix.rid }}.*.nupkg
58- retention-days : 30
59- if-no-files-found : error
60-
61- - name : 🐛 logs
62- uses : actions/upload-artifact@v4
63- if : runner.debug && always()
64- with :
65- name : logs-${{ matrix.rid }}
66- path : ' *.binlog'
67-
6819 publish :
69- needs : native-aot
7020 runs-on : ${{ vars.PUBLISH_AGENT || 'ubuntu-latest' }}
71- env :
72- NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
73- SLEET_CONNECTION : ${{ secrets.SLEET_CONNECTION }}
7421 steps :
7522 - name : 🤘 checkout
7623 uses : actions/checkout@v4
@@ -87,79 +34,33 @@ jobs:
8734 - name : 🧪 test
8835 run : dnx --yes retest -- --no-build
8936
90- - name : 📦 pointer
37+ - name : 🙏 publish
38+ shell : pwsh
9139 run : |
92- dotnet pack src/go/go.csproj -c $env:Configuration -bl:pointer-pack.binlog
40+ $rids = dotnet msbuild src/go/go.csproj -getproperty:RuntimeIdentifiers
41+ $rids | %{ $_.Split(';') } | %{ $_.Trim() } | ? { $_ } | %{ dotnet publish src/go/go.csproj -r $_ }
9342
94- - name : 📦 fallback
95- run : |
96- dotnet pack src/go/go.csproj -c $env:Configuration -r any -bl:any-pack.binlog
97-
98- - name : 📤 package
99- uses : actions/upload-artifact@v4
100- with :
101- name : package-any
102- path : bin/*.nupkg
103- retention-days : 30
104- if-no-files-found : error
105-
106- - name : 📥 packages
107- uses : actions/download-artifact@v4
108- with :
109- pattern : package-*
110- path : bin
111- merge-multiple : true
43+ - name : 📦 pack
44+ run : dotnet pack src/go/go.csproj --no-build -m:1 -bl:pack.binlog
11245
11346 - name : 🐛 logs
11447 uses : actions/upload-artifact@v4
11548 if : runner.debug && always()
11649 with :
117- name : logs-publish
50+ name : logs
11851 path : ' *.binlog'
11952
12053 - name : 🚀 nuget
54+ env :
55+ NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
12156 if : ${{ env.NUGET_API_KEY != '' && github.event.action != 'prereleased' }}
122- run : |
123- $packages = @(Get-ChildItem bin -Filter *.nupkg | Where-Object Name -NotLike '*.symbols.nupkg' | Sort-Object Name)
124- $runtimePackagePattern = '^go\.(win-x64|win-arm64|linux-x64|linux-arm64|osx-x64|osx-arm64|any)\..+\.nupkg$'
125- $runtimePackages = @($packages | Where-Object Name -Match $runtimePackagePattern)
126- $pointerPackages = @($packages | Where-Object Name -NotMatch $runtimePackagePattern)
127-
128- if ($runtimePackages.Count -eq 0) { throw 'No RID-specific or fallback packages found.' }
129- if ($pointerPackages.Count -eq 0) { throw 'No top-level pointer package found.' }
130-
131- foreach ($package in $runtimePackages) {
132- dotnet nuget push $package.FullName -s https://api.nuget.org/v3/index.json -k $env:NUGET_API_KEY --skip-duplicate
133- }
134-
135- foreach ($package in $pointerPackages) {
136- dotnet nuget push $package.FullName -s https://api.nuget.org/v3/index.json -k $env:NUGET_API_KEY --skip-duplicate
137- }
57+ working-directory : bin
58+ run : dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate
13859
13960 - name : 🚀 sleet
61+ env :
62+ SLEET_CONNECTION : ${{ secrets.SLEET_CONNECTION }}
14063 if : env.SLEET_CONNECTION != ''
14164 run : |
142- $packages = @(Get-ChildItem bin -Filter *.nupkg | Where-Object Name -NotLike '*.symbols.nupkg' | Sort-Object Name)
143- $runtimePackagePattern = '^go\.(win-x64|win-arm64|linux-x64|linux-arm64|osx-x64|osx-arm64|any)\..+\.nupkg$'
144- $runtimePackages = @($packages | Where-Object Name -Match $runtimePackagePattern)
145- $pointerPackages = @($packages | Where-Object Name -NotMatch $runtimePackagePattern)
146-
147- if ($runtimePackages.Count -eq 0) { throw 'No RID-specific or fallback packages found.' }
148- if ($pointerPackages.Count -eq 0) { throw 'No top-level pointer package found.' }
149-
150- $runtimePath = Join-Path $env:RUNNER_TEMP runtime-packages
151- $pointerPath = Join-Path $env:RUNNER_TEMP pointer-package
152- New-Item -ItemType Directory -Force -Path $runtimePath, $pointerPath | Out-Null
153-
154- Copy-Item -Path $runtimePackages.FullName -Destination $runtimePath
155- Copy-Item -Path $pointerPackages.FullName -Destination $pointerPath
156-
157- $sleetVersion = (Invoke-RestMethod -Uri $env:SLEET_FEED_URL).'sleet:version'
158- if ($sleetVersion) {
159- dotnet tool update sleet -g --allow-downgrade --version $sleetVersion
160- } else {
161- dotnet tool update sleet -g --allow-downgrade
162- }
163-
164- sleet push $runtimePath --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=$env:SLEET_CONNECTION" -p "SLEET_FEED_TYPE=azure"
165- sleet push $pointerPath --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=$env:SLEET_CONNECTION" -p "SLEET_FEED_TYPE=azure"
65+ dotnet tool update sleet -g --allow-downgrade --version $(curl -s --compressed ${{ vars.SLEET_FEED_URL }} | jq '.["sleet:version"]' -r)
66+ sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found"
0 commit comments