Add CI, packaging, and tag-driven NuGet release pipeline#1
Conversation
|
@copilot how are all the test going to run if we don't run the make command first? |
The current test suite is unit-only and uses fake bridge/platform implementations, so it does not require |
There was a problem hiding this comment.
Pull request overview
This PR adds a GitHub Actions-based CI/packaging/release pipeline for the repository and aligns NuGet package versioning with release tags by allowing the version to be injected at pack time.
Changes:
- Added CI workflow to restore/build/test on pushes to
mainand on PRs. - Added reusable packaging workflow to build the Swift native bridge and produce
.nupkg/.snupkgartifacts (with optional version override). - Added tag-driven release workflow to derive version from
v*tags, publish to NuGet, and attach artifacts to a GitHub release; documented the process indocs/releasing.mdand linked from the README.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Community.Microsoft.Extensions.AI.CoreML/Community.Microsoft.Extensions.AI.CoreML.csproj | Makes the package version override-friendly for tag-driven release version injection. |
| README.md | Links to the new release process documentation. |
| docs/releasing.md | Documents CI/package/release workflows, required repo configuration, and the tag convention. |
| .github/workflows/ci.yml | Adds CI validation workflow for restore/build/test. |
| .github/workflows/package.yml | Adds reusable packaging workflow for building the native bridge and packing NuGet artifacts. |
| .github/workflows/release.yml | Adds tag-triggered release workflow that derives version from tags and publishes to NuGet/GitHub Releases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c3988e283
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if [ -n "${{ inputs.version }}" ]; then | ||
| PACK_ARGS+=("-p:Version=${{ inputs.version }}") |
There was a problem hiding this comment.
Pass the version through an environment variable
When this reusable workflow is invoked from release.yml, inputs.version comes from the pushed tag, and Git refs can contain shell-substitution syntax such as $(...) or backticks. Because the expression is interpolated directly into the bash script before execution, a tag like v$(id) turns these lines into command substitutions in both the test and the array assignment, so the package job runs attacker-chosen shell commands before the protected release environment is reached. Put the input in an env var (and/or validate it as SemVer) and reference that variable inside bash instead of embedding the expression in the script text.
Useful? React with 👍 / 👎.
This change introduces the missing GitHub Actions workflows to validate builds, produce native-backed NuGet artifacts, and publish releases from tags. It also aligns package versioning with release tags so published package versions are driven by the release pipeline rather than a hardcoded project version.
CI workflow
.github/workflows/ci.ymlfor push/PR validation.Packaging workflow (reusable)
.github/workflows/package.ymlas aworkflow_call+workflow_dispatchworkflow.macos-latest-xlarge(make bridge)..nupkgand.snupkgartifacts, with optionalversionoverride input.Release workflow
.github/workflows/release.ymltriggered byv*tags.v).package.yml, publishes artifacts to NuGet viaNUGET_API_KEY, and attaches artifacts to the GitHub release.environment: releasefor release gating/protections.Versioning alignment
Versionis now conditional inCommunity.Microsoft.Extensions.AI.CoreML.csproj, enabling tag-driven version injection during pack.Release documentation
docs/releasing.mdwith:vX.Y.Z,vX.Y.Z-suffix)README.md.