|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - main |
7 | | - - release/* |
8 | | - tags: |
9 | | - - "v*" |
10 | | - pull_request: |
11 | | - branches: |
12 | | - - main |
13 | | - - release/* |
14 | | - types: [ labeled, opened, synchronize, reopened ] |
| 7 | + - ci |
15 | 8 |
|
16 | 9 | jobs: |
17 | 10 | # Prime a single LFS cache and expose the exact key for the matrix |
18 | 11 | WarmLFS: |
19 | 12 | runs-on: ubuntu-latest |
| 13 | + permissions: |
| 14 | + contents: read |
20 | 15 | outputs: |
21 | 16 | lfs_key: ${{ steps.expose-key.outputs.lfs_key }} |
22 | 17 | steps: |
|
60 | 55 |
|
61 | 56 | Build: |
62 | 57 | needs: WarmLFS |
| 58 | + permissions: |
| 59 | + contents: read |
63 | 60 | strategy: |
64 | 61 | matrix: |
65 | 62 | isARM: |
@@ -216,6 +213,9 @@ jobs: |
216 | 213 | flags: unittests |
217 | 214 |
|
218 | 215 | Publish: |
| 216 | + permissions: |
| 217 | + contents: read |
| 218 | + packages: write |
219 | 219 | needs: [Build] |
220 | 220 | runs-on: ubuntu-latest |
221 | 221 | if: (github.event_name == 'push') |
@@ -243,19 +243,22 @@ jobs: |
243 | 243 | key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }} |
244 | 244 | restore-keys: ${{ runner.os }}-nuget- |
245 | 245 |
|
246 | | - - name: DotNet Pack |
| 246 | + - name: Compute Version |
| 247 | + id: compute-version |
247 | 248 | shell: pwsh |
248 | | - run: ./ci-pack.ps1 |
| 249 | + run: | |
| 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" |
249 | 255 |
|
250 | | - - name: Feedz Publish |
| 256 | + - name: DotNet Pack |
251 | 257 | shell: pwsh |
252 | | - 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 |
| 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 | + dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.GITHUB_TOKEN}} -s https://nuget.pkg.github.com/mediaclip/index.json --skip-duplicate |
| 264 | + dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.GITHUB_TOKEN}} -s https://nuget.pkg.github.com/mediaclip/index.json --skip-duplicate |
0 commit comments