|
34 | 34 | runs-on: ubuntu-latest
|
35 | 35 | steps:
|
36 | 36 | - name: Harden Runner
|
37 |
| - uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 |
| 37 | + uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 |
38 | 38 | with:
|
39 | 39 | egress-policy: audit
|
40 | 40 |
|
|
44 | 44 | fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
|
45 | 45 |
|
46 | 46 | - name: 'Setup .NET SDK'
|
47 |
| - uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0 |
| 47 | + uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1 |
48 | 48 | with:
|
49 | 49 | dotnet-version: 9.0.x
|
50 | 50 |
|
@@ -77,92 +77,45 @@ jobs:
|
77 | 77 | Get-ChildItem -Path ${{ env.nupkgDirectory }} -Recurse -Force
|
78 | 78 |
|
79 | 79 | - name: Upload unsigned nupkgs
|
80 |
| - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 |
| 80 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
81 | 81 | with:
|
82 | 82 | name: build-artifacts
|
83 | 83 | path: ${{ env.nupkgDirectory }}/*
|
84 | 84 | retention-days: 7
|
85 | 85 |
|
86 |
| - sign: |
87 |
| - name: Sign |
88 |
| - needs: build |
89 |
| - runs-on: windows-latest |
90 |
| - if: ${{ inputs.perform_sign }} |
91 |
| - environment: release |
92 |
| - permissions: |
93 |
| - contents: read |
94 |
| - id-token: write |
95 |
| - steps: |
96 |
| - - name: 'Setup .NET SDK' |
97 |
| - uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0 |
98 |
| - |
99 |
| - - name: 'Install Sign CLI' |
100 |
| - run: dotnet tool install --tool-path ./sign --prerelease sign |
101 |
| - |
102 |
| - - name: 'Gather nupkgs from build output' |
103 |
| - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 |
104 |
| - with: |
105 |
| - name: build-artifacts |
106 |
| - path : ${{ env.nupkgDirectory }} |
107 |
| - |
108 |
| - - name: List assets to be signed |
109 |
| - shell: pwsh |
110 |
| - run: > |
111 |
| - Get-ChildItem -Path ${{ env.nupkgDirectory }} -Include *.nupkg -Recurse -Force |
112 |
| -
|
113 |
| - - name: Authenticate to Azure |
114 |
| - uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # 2.2.0 |
115 |
| - with: |
116 |
| - allow-no-subscriptions : true |
117 |
| - client-id: ${{ secrets.AZURE_CLIENT_ID }} |
118 |
| - tenant-id: ${{ secrets.AZURE_TENANT_ID }} |
119 |
| - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
120 |
| - |
121 |
| - - name: Sign |
122 |
| - shell: pwsh |
123 |
| - run: > |
124 |
| - ./sign/sign code azure-key-vault *.nupkg --base-directory ${{ env.nupkgDirectory }} --azure-key-vault-url "${{ secrets.AZURE_KEY_VAULT_URL }}" --azure-key-vault-certificate "${{ secrets.AZURE_KEY_VAULT_CERTIFICATE }}" |
125 |
| -
|
126 |
| - - name: Upload signed nupkgs |
127 |
| - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 |
128 |
| - with: |
129 |
| - name: signed-artifacts |
130 |
| - path: ${{ env.nupkgDirectory }}/* |
131 |
| - retention-days: 7 |
132 |
| - |
133 |
| - publish: |
134 |
| - name: Publish to nuget |
135 |
| - needs: sign |
136 |
| - runs-on: ubuntu-latest |
137 |
| - if: ${{ inputs.perform_publish }} |
138 |
| - environment: release |
139 |
| - permissions: |
140 |
| - id-token: write |
141 |
| - steps: |
142 |
| - - name: 'Harden Runner' |
143 |
| - uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 |
144 |
| - with: |
145 |
| - egress-policy: audit |
146 |
| - |
147 |
| - - name: 'Setup .NET SDK' |
148 |
| - uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0 |
149 |
| - |
150 |
| - - name: 'Gather nupkgs from signing output' |
151 |
| - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 |
152 |
| - with: |
153 |
| - name: signed-artifacts |
154 |
| - path : ${{ env.nupkgDirectory }} |
155 |
| - |
156 |
| - - name: List assets to be published |
157 |
| - shell: pwsh |
158 |
| - run: > |
159 |
| - Get-ChildItem -Path ${{ env.nupkgDirectory }} -Filter *.nupkg -Recurse -Force |
160 |
| -
|
161 |
| - # Use --skip-duplicate to prevent errors if a package with the same version already exists. |
162 |
| - # This allows a retry of a failed workflow, already published packages will be skipped without error. |
163 |
| - - name: Publish NuGet package |
164 |
| - shell: pwsh |
165 |
| - run: > |
166 |
| - foreach($file in (Get-ChildItem "${{ env.nupkgDirectory }}" -Recurse -Filter *.nupkg)) { |
167 |
| - dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate |
168 |
| - } |
| 86 | + # publish: |
| 87 | + # name: Publish to nuget |
| 88 | + # needs: sign |
| 89 | + # runs-on: ubuntu-latest |
| 90 | + # if: ${{ inputs.perform_publish }} |
| 91 | + # environment: release |
| 92 | + # permissions: |
| 93 | + # id-token: write |
| 94 | + # steps: |
| 95 | + # - name: 'Harden Runner' |
| 96 | + # uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 |
| 97 | + # with: |
| 98 | + # egress-policy: audit |
| 99 | + |
| 100 | + # - name: 'Setup .NET SDK' |
| 101 | + # uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1 |
| 102 | + |
| 103 | + # - name: 'Gather nupkgs from signing output' |
| 104 | + # uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
| 105 | + # with: |
| 106 | + # name: signed-artifacts |
| 107 | + # path : ${{ env.nupkgDirectory }} |
| 108 | + |
| 109 | + # - name: List assets to be published |
| 110 | + # shell: pwsh |
| 111 | + # run: > |
| 112 | + # Get-ChildItem -Path ${{ env.nupkgDirectory }} -Filter *.nupkg -Recurse -Force |
| 113 | + |
| 114 | + # # Use --skip-duplicate to prevent errors if a package with the same version already exists. |
| 115 | + # # This allows a retry of a failed workflow, already published packages will be skipped without error. |
| 116 | + # - name: Publish NuGet package |
| 117 | + # shell: pwsh |
| 118 | + # run: > |
| 119 | + # foreach($file in (Get-ChildItem "${{ env.nupkgDirectory }}" -Recurse -Filter *.nupkg)) { |
| 120 | + # dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate |
| 121 | + # } |
0 commit comments