@@ -119,7 +119,7 @@ jobs:
119
119
- name : Pack NuGet packages (snapshot)
120
120
shell : pwsh
121
121
run : |
122
- dotnet pack -c Release -o ${{ env. NuGetDirectory }}
122
+ dotnet pack -c Release -o $env: NuGetDirectory
123
123
if : |
124
124
success() && github.ref == 'refs/heads/main'
125
125
&& matrix.version.target == 'net8.0' && matrix.os == 'windows-latest'
@@ -131,7 +131,7 @@ jobs:
131
131
if ( $env:GITHUB_REF -match '^refs/tags/v(.*)$' ) {
132
132
$VERSION=$matches[1]
133
133
Write-Host $VERSION
134
- dotnet pack -c Release -p:RELEASE_VERSION=$VERSION -o ${{ env. NuGetDirectory }}
134
+ dotnet pack -c Release -p:RELEASE_VERSION=$VERSION -o $env: NuGetDirectory
135
135
} else {
136
136
Write-Error "Failed to extract the version from env:GITHUB_REF"
137
137
Exit 1
@@ -151,19 +151,23 @@ jobs:
151
151
&& matrix.version.target == 'net8.0' && matrix.os == 'windows-latest'
152
152
- name : Publish NuGet packages (GH/always)
153
153
shell : pwsh
154
+ env :
155
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
154
156
run : |
155
- foreach($file in (Get-ChildItem "${{ env. NuGetDirectory }}" -Recurse -Include *.nupkg)) {
156
- dotnet nuget push $file --api-key ${{ secrets. GITHUB_TOKEN }} --skip-duplicate --no-symbols
157
+ foreach($file in (Get-ChildItem $ env: NuGetDirectory -Recurse -Include *.nupkg)) {
158
+ dotnet nuget push $file --api-key $env: GITHUB_TOKEN --skip-duplicate --no-symbols
157
159
}
158
160
if : |
159
161
success()
160
162
&& matrix.version.target == 'net8.0' && matrix.os == 'windows-latest'
161
163
&& (github.ref == 'refs/heads/main' || github.event_name == 'release' || inputs.release)
162
164
- name : Publish NuGet packages (NuGet.org/release)
163
165
shell : pwsh
166
+ env :
167
+ NUGET_APIKEY : ${{ secrets.NUGET_APIKEY }}
164
168
run : |
165
- foreach($file in (Get-ChildItem "${{ env. NuGetDirectory }}" -Recurse -Include *.nupkg)) {
166
- dotnet nuget push $file --api-key "${{ secrets. NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols
169
+ foreach($file in (Get-ChildItem $ env: NuGetDirectory -Recurse -Include *.nupkg)) {
170
+ dotnet nuget push $file --api-key $env: NUGET_APIKEY --source https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols
167
171
}
168
172
if : |
169
173
success()
0 commit comments