Skip to content

Add GitHub workflow to publish samples using latest NuGet version#3570

Draft
Copilot wants to merge 7 commits intomainfrom
copilot/add-github-workflow-for-samples
Draft

Add GitHub workflow to publish samples using latest NuGet version#3570
Copilot wants to merge 7 commits intomainfrom
copilot/add-github-workflow-for-samples

Conversation

Copy link
Contributor

Copilot AI commented Mar 23, 2026

  • Add .github/workflows/samples.yml with push/PR/release/workflow_dispatch triggers
  • Path filters include both samples/** and .github/workflows/samples.yml
  • Dry-run mode: always clones/inits branch, rsyncs, git add, git commit --allow-empty — only skips git push; shows git show --stat HEAD to confirm what would have been pushed
Original prompt

I have a cake target sample that creates a zip of the samples in the repo. I want to create a new GitHub workflow that will run if anything in the samples dir is changed and run the cake target, but it must lt use the version number of the latest nuget preview or stable. The cake target basically removes the project references and replaces it with nuget references. Can you open a PR with a workflow that will basically push these samples to a new branch.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI changed the title [WIP] Add GitHub workflow to run Cake target on samples changes Add GitHub workflow to publish samples using latest NuGet version Mar 23, 2026
Copilot AI requested a review from mattleibow March 23, 2026 23:39
@mattleibow
Copy link
Contributor

@copilot i wa to always commit to the same samples branch. Also, can you add a parameter to pick the git sha for the sample to use. Also also I want to trigger on a release. Don't force push, just add a new commit.

… force push

Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mono/SkiaSharp/sessions/7df4a82e-892a-4246-a50f-bdf62b51d869
Copy link
Contributor Author

Copilot AI commented Mar 24, 2026

@copilot i wa to always commit to the same samples branch. Also, can you add a parameter to pick the git sha for the sample to use. Also also I want to trigger on a release. Don't force push, just add...

Done in caadc2e. Here's what changed:

  • Fixed branch — always pushes to samples instead of a versioned branch
  • sha input — added to workflow_dispatch; the checkout step uses ref: ${{ inputs.sha || github.sha }}
  • Release trigger — added release: [published]
  • No force push — the publish step now clones the existing samples branch (or inits a new one), rsyncs the generated output over it, and pushes a regular commit, preserving history

@mattleibow
Copy link
Contributor

@copilot please add a dry run support if triggers by PR so we can test. Do everything except the push.

Copy link
Contributor Author

Copilot AI commented Mar 24, 2026

@copilot please add a dry run support if triggers by PR so we can test. Do everything except the push.

Done in 990137c. Two ways to trigger a dry run:

  1. Open a PR that touches samples/** — the new pull_request trigger fires automatically and the publish step skips the push, listing all generated files instead.
  2. workflow_dispatch — a new dry_run boolean input lets you run manually without pushing.

In both cases everything up to and including dotnet cake --target=samples-generate executes normally; only the final git push is skipped.

@mattleibow
Copy link
Contributor

@copilot we also need to run this if a PR touches this workflow file. Same with a push. If this file or a sample changes

Copy link
Contributor Author

Copilot AI commented Mar 24, 2026

@copilot we also need to run this if a PR touches this workflow file. Same with a push. If this file or a sample changes

Done in 0086bd7. Both push and pull_request triggers now include .github/workflows/samples.yml in their path filters alongside samples/**.

Removed 'develop' and 'release/**' branches from workflow triggers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants