From 2d2b48a19145bfed7fc654fdf08ee880ebeda558 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2026 05:49:38 +0000 Subject: [PATCH 1/2] Bump the skiasharp group with 2 updates Bumps SkiaSharp from 4.155.0 to 4.156.1 Bumps SkiaSharp.NativeAssets.Linux.NoDependencies from 4.155.0 to 4.156.1 --- updated-dependencies: - dependency-name: SkiaSharp dependency-version: 4.156.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: skiasharp - dependency-name: SkiaSharp.NativeAssets.Linux.NoDependencies dependency-version: 4.156.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: skiasharp ... Signed-off-by: dependabot[bot] --- SkiaSharpCompare/SkiaSharpCompare.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SkiaSharpCompare/SkiaSharpCompare.csproj b/SkiaSharpCompare/SkiaSharpCompare.csproj index 9ca3b59..442c290 100644 --- a/SkiaSharpCompare/SkiaSharpCompare.csproj +++ b/SkiaSharpCompare/SkiaSharpCompare.csproj @@ -45,8 +45,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive From 76481217fb706b1857e4ac4311b100137280eaed Mon Sep 17 00:00:00 2001 From: Stefan Seeland <168659+stesee@users.noreply.github.com> Date: Tue, 17 Nov 2026 18:10:44 +0100 Subject: [PATCH 2/2] Use NuGet Trusted Publishing in CI workflow Build once and share the NuGet package as an artifact, so deploy jobs download it instead of rebuilding. - Upload the nupkg as an artifact from the Linux build job. - Move the Test step before the CLI publish steps. - Deploy jobs use NuGet/login (OIDC) instead of long-lived API key secrets, with the NUGET_USER secret. - Replace the workflow-wide contents: write with per-job permissions (id-token: write, plus contents: write for the release job only). - Download only cli-artifacts-* in the release job and pass --repo and --target to gh release create. - Drop the redundant checkout, restore and build steps from the deploy jobs. - Fix whitespace and add a trailing newline. --- .github/workflows/dotnet.yml | 85 ++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 37 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ca8b1c2..533d07c 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -8,9 +8,6 @@ on: paths-ignore: - '**.md' -permissions: - contents: write - jobs: build: runs-on: ${{ matrix.os }} @@ -22,7 +19,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v6 with: - dotnet-version: | + dotnet-version: | 10.0.x - name: Check formatting run: dotnet format --verify-no-changes @@ -30,6 +27,8 @@ jobs: run: dotnet restore - name: Build run: dotnet build --configuration Release --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal --configuration Release - name: Publish SkiaSharpCompare.Cli (Linux) if: runner.os == 'Linux' @@ -55,67 +54,79 @@ jobs: path: ./artifacts/cli retention-days: 7 - - name: Test - run: dotnet test --no-build --verbosity normal --configuration Release + - name: Upload NuGet package + if: runner.os == 'Linux' + uses: actions/upload-artifact@v7 + with: + name: nuget-package + path: ./SkiaSharpCompare/bin/Release/*.*nupkg + if-no-files-found: error + retention-days: 7 deployRelease: if: startsWith(github.ref, 'refs/heads/release') - runs-on: ubuntu-latest needs: build + runs-on: ubuntu-latest + permissions: + contents: write # gh release create + id-token: write # NuGet Trusted Publishing (OIDC) steps: - - uses: actions/checkout@v7 - name: Setup .NET uses: actions/setup-dotnet@v6 with: - dotnet-version: | + dotnet-version: | 10.0.x - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build --configuration Release --no-restore + - name: Download NuGet package + uses: actions/download-artifact@v8 + with: + name: nuget-package + path: ./nuget - name: Download CLI artifacts uses: actions/download-artifact@v8 with: - path: ./artifacts_download + pattern: cli-artifacts-* + path: ./artifacts_download + - name: NuGet login (Trusted Publishing) + uses: NuGet/login@v1 + id: nugetLogin + with: + user: ${{ secrets.NUGET_USER }} - name: NugetPush - env: - NUGET_TOKEN_EXISTS: ${{ secrets.NUGET_TOKEN }} - if: env.NUGET_TOKEN_EXISTS != '' run: | - dotnet nuget push ./SkiaSharpCompare/bin/Release/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TOKEN}} --source https://api.nuget.org/v3/index.json + dotnet nuget push ./nuget/*.nupkg --skip-duplicate --api-key ${{ steps.nugetLogin.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json - name: Github release shell: bash env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: env.GITHUB_TOKEN != '' + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - # Attach all downloaded CLI artifacts regardless of OS - zip -r cli-artifacts.zip ./artifacts_download - gh release create ${{env.CURRENT_VERSION}} ./SkiaSharpCompare/bin/Release/*.*nupkg cli-artifacts.zip --generate-notes + # Attach all downloaded CLI artifacts regardless of OS + zip -r cli-artifacts.zip ./artifacts_download + gh release create ${{ env.CURRENT_VERSION }} ./nuget/*.*nupkg cli-artifacts.zip --repo ${{ github.repository }} --target ${{ github.sha }} --generate-notes deployTest: if: ${{ github.ref == 'refs/heads/main' }} - runs-on: ubuntu-latest needs: build + runs-on: ubuntu-latest + permissions: + id-token: write # NuGet Trusted Publishing (OIDC) steps: - - uses: actions/checkout@v7 - name: Setup .NET uses: actions/setup-dotnet@v6 with: - dotnet-version: | + dotnet-version: | 10.0.x - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build --configuration Release --no-restore - - name: Download CLI artifacts + - name: Download NuGet package uses: actions/download-artifact@v8 with: - path: ./artifacts_download + name: nuget-package + path: ./nuget + - name: NuGet login (Trusted Publishing) + uses: NuGet/login@v1 + id: nugetLogin + with: + user: ${{ secrets.NUGET_USER }} + token-service-url: https://int.nugettest.org/api/v2/token + audience: https://int.nugettest.org - name: NugetPush - env: - NUGET_TOKEN_EXISTS: ${{ secrets.NUGET_TEST_TOKEN }} - if: env.NUGET_TOKEN_EXISTS != '' run: | - ls ./SkiaSharpCompare/bin/Release - dotnet nuget push ./SkiaSharpCompare/bin/Release/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TEST_TOKEN}} --source https://apiint.nugettest.org/v3/index.json \ No newline at end of file + dotnet nuget push ./nuget/*.nupkg --skip-duplicate --api-key ${{ steps.nugetLogin.outputs.NUGET_API_KEY }} --source https://apiint.nugettest.org/v3/index.json