@@ -117,25 +117,31 @@ jobs:
117
117
attestations : write
118
118
runs-on : windows-2019
119
119
needs : [build-windows, build-linux-amd64, build-linux-arm64, build-macos]
120
+ env :
121
+ PACKAGE_VERSION : ${{ github.event.inputs.version != '' && github.event.inputs.version || '1.0.0' }}
122
+ GITHUB_REPO_URL : https://github.com/${{ github.repository }}
120
123
steps :
121
- - uses : actions/download-artifact@v4
124
+ - name : Download contents, set metadata and package
125
+ uses : actions/download-artifact@v4
122
126
- run : |
123
127
mv nuspec/*.nuspec .
124
128
mv nuspec/readme.md .
125
129
$nuspec = [xml](gc Yubico.NativeShims.nuspec)
126
130
$repo = $nuspec.CreateElement("repository")
127
- $repo.SetAttribute("url","https://github.com/${{ github.repository }} ")
131
+ $repo.SetAttribute("url","$env:GITHUB_REPO_URL ")
128
132
$repo.SetAttribute("type","git")
129
133
$nuspec.package.metadata.AppendChild($repo)
130
- $nuspec.package.metadata.version = "${{ github.event.inputs.version }}"
134
+ $repo.SetAttribute("url","$env:GITHUB_REPO_URL")
131
135
$nuspec.Save("Yubico.NativeShims.nuspec")
132
136
cat Yubico.NativeShims.nuspec
133
137
- run : nuget pack Yubico.NativeShims.nuspec
134
- - uses : actions/upload-artifact@v4
138
+
139
+ - name : Upload Nuget Package
140
+ uses : actions/upload-artifact@v4
135
141
with :
136
142
name : NuGet Package NativeShims
137
143
path : Yubico.NativeShims.*.nupkg
138
-
144
+
139
145
- name : Generate artifact attestation
140
146
uses : actions/attest-build-provenance@v2
141
147
with :
@@ -159,4 +165,4 @@ jobs:
159
165
name : Yubico.NativeShims.nupkg
160
166
- run : |
161
167
dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Yubico/index.json"
162
- dotnet nuget push Yubico.NativeShims.*.nupkg --source "github" --api-key ${{ secrets.GITHUB_TOKEN }}
168
+ dotnet nuget push Yubico.NativeShims.*.nupkg --source "github" --api-key ${{ secrets.GITHUB_TOKEN }}
0 commit comments