File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed
Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -119,3 +119,45 @@ jobs:
119119 Write-Output "::error::$invalidPackages NuGet package(s) failed validation."
120120 exit 1
121121 }
122+
123+ publish-nuget :
124+ needs : [ build-test, validate-packages ]
125+ runs-on : ubuntu-latest
126+ if : |
127+ github.event.repository.fork == false &&
128+ startsWith(github.ref, 'refs/tags/')
129+
130+ environment :
131+ name : NuGet.org
132+ url : https://www.nuget.org/profiles/Grafana
133+
134+ permissions :
135+ contents : read
136+ id-token : write
137+
138+ steps :
139+
140+ - name : Download packages
141+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
142+ with :
143+ name : packages-windows
144+
145+ - name : Setup .NET SDK
146+ uses : actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
147+ with :
148+ dotnet-version : ${{ needs.build-test.outputs.dotnet-sdk-version }}
149+
150+ # TODO Store the NuGet token in Vault
151+ - uses : grafana/shared-workflows/actions/get-vault-secrets@9f37f656e063f0ad0b0bfc38d49894b57d363936 # get-vault-secrets/v1.2.1
152+ id : get-token
153+ with :
154+ export_env : false
155+ repo_secrets : |
156+ token=nuget:token
157+
158+ - name : Push NuGet packages to NuGet.org
159+ shell : bash
160+ env :
161+ API_KEY : ${{ fromJSON(steps.get-token.outputs.secrets).token }}
162+ SOURCE : ' https://api.nuget.org/v3/index.json'
163+ run : dotnet nuget push "*.nupkg" --api-key "${API_KEY}" --skip-duplicate --source "${SOURCE}"
Original file line number Diff line number Diff line change 2424 - name : Review dependencies
2525 uses : actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1
2626 with :
27+ allow-dependencies-licenses : ' pkg:githubactions/grafana/shared-workflows/actions/get-vault-secrets'
2728 allow-licenses : ' Apache-2.0,BSD-3-Clause,MIT'
You can’t perform that action at this time.
0 commit comments