Skip to content

Add NuGet feed management tools and PR package download script#3479

Merged
mattleibow merged 20 commits into
mainfrom
dev/testing
Jan 31, 2026
Merged

Add NuGet feed management tools and PR package download script#3479
mattleibow merged 20 commits into
mainfrom
dev/testing

Conversation

@mattleibow
Copy link
Copy Markdown
Collaborator

@mattleibow mattleibow commented Jan 30, 2026

Summary

This PR adds tooling for managing Azure DevOps NuGet feeds and downloading PR packages.

Changes

Feed Management Script (scripts/manage-nuget-feed.ps1)

PowerShell script to manage Azure DevOps NuGet feeds:

  • Move packages from one feed to another (e.g., _* prefixed packages → SkiaSharp-CI archive feed)
  • Delete bad versions matching patterns like -pr.*, -preview-* (malformed prerelease tags)
  • Keep valid versions: -preview.N, -rc.N, -nightly.N, -stable.N, -alpha.N, and stable releases
  • Checks destination feed before downloading to skip already-copied packages
  • Stateless and idempotent - safe to re-run

GitHub Action (.github/workflows/manage-nuget-feed.yml)

Workflow with parallel matrix jobs for efficient processing:

  • 6 jobs for underscore packages (_NativeAssets, _NuGets, _Symbols, etc.)
  • 5 jobs for regular packages (SkiaSharp, HarfBuzzSharp families)
  • Modes: parallel-underscore, parallel-all, single

PR Package Download Script (scripts/get-skiasharp-pr.ps1)

Script for external users to download PR build packages:

# One-liner (no repo clone needed)
iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 1234"

# Then add as NuGet source
dotnet nuget add source ~/.skiasharp/hives/pr-1234/packages --name skiasharp-pr-1234

Features:

  • Downloads from Azure DevOps public CI (no auth required)
  • Prefers nuget_preview artifact (smaller), falls back to full nuget
  • Finds latest build by default (in-progress, failed, or successful)
  • -SuccessfulOnly flag to restrict to successful builds only
  • Progress display during download

Pipeline Updates (scripts/azure-templates-stages-package.yml)

  • Added nuget_preview artifact containing only prerelease packages (*-*.nupkg)
  • Smaller download for PR testing (~50% smaller than full artifact)

Documentation Updates

  • documentation/versioning.md - Updated PR packages section with one-liner usage
  • documentation/releasing.md - Added SkiaSharp-CI feed to feeds table

Feed Structure

Feed Purpose Packages
SkiaSharp Public preview/release packages SkiaSharp., HarfBuzzSharp.
SkiaSharp-CI Internal CI artifacts _NativeAssets, _NuGets, _Symbols, etc.

Testing

  • Feed management script tested on CI with real packages
  • PR download script tested locally
  • Workflow runs successfully in parallel mode

mattleibow and others added 3 commits January 30, 2026 21:09
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Script to move _* packages to archive feed and delete -pr versions
- Supports phased migration (CopyOnly, DeleteOnly, All)
- Local caching with integrity verification
- Resumable with state file
- GitHub Action with workflow_dispatch for manual runs
- PAT read from AZURE_DEVOPS_PAT environment variable/secret
@github-actions
Copy link
Copy Markdown
Contributor

Triage Summary

No labels will be applied because the issue does not fit any of the available categories and primarily concerns tooling and automation for managing a NuGet feed.

This issue is not considered a regression as it does not relate to any prior functionality or performance issues.

Additional remarks:

  • The issue focuses on building a script and GitHub Action for NuGet feed management without mentioning a specific platform or technology alignment with existing labels, such as documentation or specific backend technologies.
Detailed Summary and Actions

Summary of the triage:

  • The issue is centered around tooling and automation for managing a NuGet feed, which does not fall within any existing labels.
  • It involves creating a script and GitHub Action related to Azure DevOps NuGet feed management.
  • There are no specific operating systems or platforms mentioned, preventing label assignment.
  • The available labels do not match the content of the issue at all.

Summary of the actions that will be performed:

Action Item Description
No Action - There are no applicable labels for this issue based on its content.

This entire triage process was automated by AI and mistakes may have been made. Please let us know so we can continue to improve.

- parallel-underscore: Run _NativeAssets, _NuGets, _NuGetsPreview, _Symbols, _SymbolsPreview in parallel
- parallel-all: Also includes SkiaSharp, HarfBuzzSharp groups in parallel
- single: Manual filter for specific packages
- PR triggers run underscore packages in dry-run mode
- Wrap Console.KeyAvailable in try/catch for CI environments
- Check IsInteractive before keyboard polling
- Respect dry_run input in all parallel jobs (was hardcoded to Execute)
This saves significant time/bandwidth for large packages that were already copied.
- Add scripts/get-skiasharp-pr.ps1 for easy PR package downloads
- Add nuget_preview artifact to pipeline (smaller, prerelease only)
- Update versioning.md with simplified PR package instructions
- Update releasing.md with CI feed documentation
- No authentication required (public builds)
Since we now check if packages exist in the destination feed before
downloading, caching is unnecessary. Packages are now downloaded to
a temp directory, pushed immediately, and cleaned up.

This fixes disk space issues on CI runners where caching thousands
of large packages was filling up the runner.
Since CI runs on fresh images, state file provides no value - packages
are already checked against destination feed before download. Removed:

- StateFile parameter
- Get-State and Save-State functions
- All state tracking (CopiedPackages, MovedPackages, DeletedVersions, etc.)
- State artifact uploads from workflow

The script is now fully stateless and idempotent.
The script now tries in order:
1. Successful completed builds
2. Any completed builds (failed tests but artifacts may be fine)
3. In-progress builds (artifacts may already be published)

This allows downloading artifacts even when tests are still running
or have failed, since the NuGet packages are typically ready earlier.
- Remove -Filter parameter, always extract prerelease packages (*-*.nupkg)
- Always find the latest build by default (regardless of status)
- Add -SuccessfulOnly flag to restrict to successful builds only
- Suggest -SuccessfulOnly when artifacts aren't available on latest build
@mattleibow mattleibow changed the title Add NuGet feed management script and GitHub Action Add NuGet feed management tools and PR package download script Jan 31, 2026
- scripts/get-skiasharp-pr.sh - bash equivalent of the PowerShell script
- Uses curl/jq/unzip (no gh cli or authentication needed)
- Same options: --successful-only, --force, --list, --build-id
- Updated docs with bash one-liner and options table
Each _NativeAssets.{platform} package now has its own job:
- _NativeAssets.alpine, alpinenodeps, android, ios, iossimulator
- _NativeAssets.linux, linuxnodeps, maccatalyst, nanoserver, osx
- _NativeAssets.tizen, tvos, uwp, wasm, watchos, windows, winui

This prevents disk space exhaustion from processing all platforms in one job.
@mattleibow mattleibow merged commit 0206402 into main Jan 31, 2026
50 checks passed
@mattleibow mattleibow deleted the dev/testing branch January 31, 2026 12:53
@mattleibow mattleibow added the copilot Created by GitHub Copilot label Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot Created by GitHub Copilot

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant