1010env :
1111 DOTNET_NOLOGO : true
1212 Configuration : Release
13- PackOnBuild : true
14- GeneratePackageOnBuild : true
15- VersionLabel : refs/tags/${{ github.event.release.tag_name }}
13+ VersionLabel : ${{ github.ref }}
1614 GH_TOKEN : ${{ secrets.GH_TOKEN }}
1715 MSBUILDTERMINALLOGGER : auto
1816 SLEET_FEED_URL : https://api.nuget.org/v3/index.json
19-
17+
18+ defaults :
19+ run :
20+ shell : pwsh
21+
2022jobs :
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+
2168 publish :
69+ needs : native-aot
2270 runs-on : ${{ vars.PUBLISH_AGENT || 'ubuntu-latest' }}
71+ env :
72+ NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
73+ SLEET_CONNECTION : ${{ secrets.SLEET_CONNECTION }}
2374 steps :
2475 - name : 🤘 checkout
2576 uses : actions/checkout@v4
@@ -34,27 +85,81 @@ jobs:
3485 run : dotnet build -m:1 -bl:build.binlog
3586
3687 - name : 🧪 test
37- shell : pwsh
3888 run : dnx --yes retest -- --no-build
3989
90+ - name : 📦 pointer
91+ run : |
92+ dotnet pack src/go/go.csproj -c $env:Configuration -bl:pointer-pack.binlog
93+
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
112+
40113 - name : 🐛 logs
41114 uses : actions/upload-artifact@v4
42115 if : runner.debug && always()
43116 with :
44- name : logs
117+ name : logs-publish
45118 path : ' *.binlog'
46119
47120 - name : 🚀 nuget
48- env :
49- NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
50121 if : ${{ env.NUGET_API_KEY != '' && github.event.action != 'prereleased' }}
51- working-directory : bin
52- run : dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate
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+ }
53138
54139 - name : 🚀 sleet
55- env :
56- SLEET_CONNECTION : ${{ secrets.SLEET_CONNECTION }}
57140 if : env.SLEET_CONNECTION != ''
58141 run : |
59- dotnet tool update sleet -g --allow-downgrade --version $(curl -s --compressed ${{ vars.SLEET_FEED_URL }} | jq '.["sleet:version"]' -r)
60- 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"
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"
0 commit comments