|
1 | | -name: Manual Build, Test, Sign, Publish |
| 1 | +name: Release Build, Test, Sign, Publish |
2 | 2 | on: |
3 | 3 | workflow_dispatch: |
4 | 4 | inputs: |
|
82 | 82 | run: > |
83 | 83 | Get-ChildItem -Path ${env:NUPKG_DIRECTORY} -Recurse -Force |
84 | 84 |
|
85 | | - - name: Upload unsigned nupkgs |
| 85 | + - name: Upload unsigned nupkgs to artifacts |
86 | 86 | uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
87 | 87 | with: |
88 | 88 | name: build-artifacts |
@@ -129,7 +129,7 @@ jobs: |
129 | 129 | run: > |
130 | 130 | ./sign/sign code azure-key-vault *.nupkg --base-directory ${env:NUPKG_DIRECTORY} --azure-key-vault-url "${{ secrets.AZURE_KEY_VAULT_URL }}" --azure-key-vault-certificate "${{ secrets.AZURE_KEY_VAULT_CERTIFICATE }}" |
131 | 131 |
|
132 | | - - name: Upload signed nupkgs |
| 132 | + - name: Upload signed nupkgs to artifacts |
133 | 133 | uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
134 | 134 | with: |
135 | 135 | name: signed-artifacts |
@@ -164,11 +164,17 @@ jobs: |
164 | 164 | run: > |
165 | 165 | Get-ChildItem -Path ${env:NUPKG_DIRECTORY} -Filter *.nupkg -Recurse -Force |
166 | 166 |
|
| 167 | + - name: Authenticate to nuget |
| 168 | + uses: NuGet/login@d883674c922ba7e5cc0370927b10a33b67d54677 # v1.0.0 |
| 169 | + id: nugetlogin |
| 170 | + with: |
| 171 | + user: ${{secrets.NUGET_USERNAME}} |
| 172 | + |
167 | 173 | # Use --skip-duplicate to prevent errors if a package with the same version already exists. |
168 | 174 | # This allows a retory of a failed workflow, already published packages will be skipped without error. |
169 | | - - name: Publish NuGet package |
| 175 | + - name: Publish NuGet packages |
170 | 176 | shell: pwsh |
171 | 177 | run: > |
172 | 178 | foreach($file in (Get-ChildItem "${env:NUPKG_DIRECTORY}" -Recurse -Filter *.nupkg)) { |
173 | | - dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate |
| 179 | + dotnet nuget push $file --api-key "${{ steps.nugetlogin.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate |
174 | 180 | } |
0 commit comments