|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - main |
| 7 | + - ci |
7 | 8 | - release/* |
8 | | - tags: |
9 | | - - "v*" |
10 | | - pull_request: |
11 | | - branches: |
12 | | - - main |
13 | | - - release/* |
14 | | - types: [ labeled, opened, synchronize, reopened ] |
15 | 9 |
|
16 | 10 | jobs: |
17 | 11 | # Prime a single LFS cache and expose the exact key for the matrix |
@@ -216,6 +210,9 @@ jobs: |
216 | 210 | path: tests/Images/ActualOutput/ |
217 | 211 |
|
218 | 212 | Publish: |
| 213 | + permissions: |
| 214 | + id-token: write # Required for OIDC |
| 215 | + contents: read |
219 | 216 | needs: [Build] |
220 | 217 | runs-on: ubuntu-latest |
221 | 218 | if: (github.event_name == 'push') |
@@ -243,19 +240,24 @@ jobs: |
243 | 240 | key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }} |
244 | 241 | restore-keys: ${{ runner.os }}-nuget- |
245 | 242 |
|
246 | | - - name: DotNet Pack |
247 | | - shell: pwsh |
248 | | - run: ./ci-pack.ps1 |
| 243 | + - name: Install Sleet |
| 244 | + run: dotnet tool install -g sleet |
249 | 245 |
|
250 | | - - name: Feedz Publish |
| 246 | + - name: Compute Version |
| 247 | + id: compute-version |
251 | 248 | shell: pwsh |
252 | 249 | run: | |
253 | | - dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/nuget/index.json --skip-duplicate |
254 | | - dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/symbols --skip-duplicate |
| 250 | + $date = Get-Date -Format "yyyy.MM.dd" |
| 251 | + $buildNumber = "${{ github.run_number }}" |
| 252 | + $version = "$date-mc.$buildNumber" |
| 253 | + echo "version=$version" >> $env:GITHUB_OUTPUT |
| 254 | + echo "Computed version: $version" |
| 255 | +
|
| 256 | + - name: DotNet Pack |
| 257 | + shell: pwsh |
| 258 | + run: ./ci-pack.ps1 -version "${{ steps.compute-version.outputs.version }}" |
255 | 259 |
|
256 | | - - name: NuGet Publish |
257 | | - if: ${{ startsWith(github.ref, 'refs/tags/') }} |
| 260 | + - name: Publish Internal |
258 | 261 | shell: pwsh |
259 | 262 | run: | |
260 | | - dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate |
261 | | - dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate |
| 263 | + sleet push .\artifacts\ --config sleet.json artifacts |
0 commit comments