|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - main |
7 | | - tags: |
8 | | - - "v*" |
9 | | - pull_request: |
10 | | - branches: |
11 | | - - main |
12 | | - - release/* |
13 | | - types: [ labeled, opened, synchronize, reopened ] |
| 7 | + - ci |
14 | 8 | jobs: |
15 | 9 | # Prime a single LFS cache and expose the exact key for the matrix |
16 | 10 | WarmLFS: |
17 | 11 | runs-on: ubuntu-latest |
| 12 | + permissions: |
| 13 | + contents: read |
18 | 14 | outputs: |
19 | 15 | lfs_key: ${{ steps.expose-key.outputs.lfs_key }} |
20 | 16 | steps: |
|
55 | 51 | - name: Git Pull LFS |
56 | 52 | shell: bash |
57 | 53 | run: git lfs pull |
58 | | - |
| 54 | + |
59 | 55 | Build: |
60 | 56 | needs: WarmLFS |
| 57 | + permissions: |
| 58 | + contents: read |
61 | 59 | strategy: |
62 | 60 | matrix: |
63 | 61 | isARM: |
@@ -210,6 +208,9 @@ jobs: |
210 | 208 |
|
211 | 209 |
|
212 | 210 | Publish: |
| 211 | + permissions: |
| 212 | + id-token: write # Required for OIDC |
| 213 | + contents: read |
213 | 214 | needs: [Build] |
214 | 215 |
|
215 | 216 | runs-on: ubuntu-latest |
@@ -240,20 +241,31 @@ jobs: |
240 | 241 | key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }} |
241 | 242 | restore-keys: ${{ runner.os }}-nuget- |
242 | 243 |
|
243 | | - - name: DotNet Pack |
| 244 | + - name: Compute Version |
| 245 | + id: compute-version |
244 | 246 | shell: pwsh |
245 | | - run: ./ci-pack.ps1 |
| 247 | + run: | |
| 248 | + $date = Get-Date -Format "yyyy.MM.dd" |
| 249 | + $buildNumber = "${{ github.run_number }}" |
| 250 | + $version = "$date-mc.$buildNumber" |
| 251 | + echo "version=$version" >> $env:GITHUB_OUTPUT |
| 252 | + echo "Computed version: $version" |
246 | 253 |
|
247 | | - - name: Feedz Publish |
| 254 | + - name: DotNet Pack |
248 | 255 | shell: pwsh |
249 | | - run: | |
250 | | - dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/nuget/index.json --skip-duplicate |
251 | | - dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/symbols --skip-duplicate |
| 256 | + run: ./ci-pack.ps1 -version "${{ steps.compute-version.outputs.version }}" |
| 257 | + |
| 258 | + - name: Azure Login |
| 259 | + uses: azure/login@v2 |
| 260 | + with: |
| 261 | + client-id: ${{ secrets.AZURE_CLIENT_ID }} |
| 262 | + tenant-id: ${{ secrets.AZURE_TENANT_ID }} |
| 263 | + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
252 | 264 |
|
253 | | - - name: NuGet Publish |
254 | | - if: ${{ startsWith(github.ref, 'refs/tags/') }} |
| 265 | + - name: Install Sleet |
| 266 | + run: dotnet tool install -g sleet |
| 267 | + |
| 268 | + - name: Publish Internal |
255 | 269 | shell: pwsh |
256 | 270 | run: | |
257 | | - dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate |
258 | | - dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate |
259 | | -
|
| 271 | + sleet push ./artifacts --config sleet.json artifacts |
0 commit comments