From 64ca2e54e8e52eb54a5149b077b7ca67771911c1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Jun 2026 12:53:13 +0000 Subject: [PATCH 1/2] Add CI, packaging, and tag-based release workflows --- .github/workflows/ci.yml | 31 +++++++ .github/workflows/package.yml | 56 ++++++++++++ .github/workflows/release.yml | 85 +++++++++++++++++++ README.md | 1 + docs/releasing.md | 38 +++++++++ ...nity.Microsoft.Extensions.AI.CoreML.csproj | 2 +- 6 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/package.yml create mode 100644 .github/workflows/release.yml create mode 100644 docs/releasing.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..aca43e6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 10.0.x + + - name: Restore library + run: dotnet restore src/Community.Microsoft.Extensions.AI.CoreML/Community.Microsoft.Extensions.AI.CoreML.csproj + + - name: Build library + run: dotnet build src/Community.Microsoft.Extensions.AI.CoreML/Community.Microsoft.Extensions.AI.CoreML.csproj --configuration Release --no-restore + + - name: Test + run: dotnet test src/Community.Microsoft.Extensions.AI.CoreML.Tests/Community.Microsoft.Extensions.AI.CoreML.Tests.csproj --configuration Release --no-restore diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..1ed5acc --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,56 @@ +name: Package + +on: + workflow_call: + inputs: + version: + description: Package version override (for example: 1.2.3 or 1.2.3-preview1) + required: false + type: string + workflow_dispatch: + inputs: + version: + description: Package version override (for example: 1.2.3 or 1.2.3-preview1) + required: false + type: string + +permissions: + contents: read + +jobs: + package: + runs-on: macos-latest-xlarge + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 10.0.x + + - name: Build native bridge + run: make bridge + + - name: Pack NuGet package + shell: bash + run: | + mkdir -p artifacts/nuget + PACK_ARGS=( + "-c" "Release" + "-o" "artifacts/nuget" + "-p:ContinuousIntegrationBuild=true" + ) + + if [ -n "${{ inputs.version }}" ]; then + PACK_ARGS+=("-p:Version=${{ inputs.version }}") + fi + + dotnet pack src/Community.Microsoft.Extensions.AI.CoreML/Community.Microsoft.Extensions.AI.CoreML.csproj "${PACK_ARGS[@]}" + + - name: Upload NuGet artifacts + uses: actions/upload-artifact@v4 + with: + name: nuget-packages + path: artifacts/nuget/* + if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..209c8ef --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,85 @@ +name: Release + +on: + push: + tags: + - "v*" + +permissions: + contents: write + +jobs: + derive-version: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.value }} + steps: + - name: Derive version from tag + id: version + shell: bash + run: | + TAG="${GITHUB_REF_NAME}" + VERSION="${TAG#v}" + if [ -z "$VERSION" ] || [ "$VERSION" = "$TAG" ]; then + echo "Tag must start with 'v' and include a version (example: v1.2.3)." >&2 + exit 1 + fi + echo "value=$VERSION" >> "$GITHUB_OUTPUT" + + package: + needs: derive-version + uses: ./.github/workflows/package.yml + with: + version: ${{ needs.derive-version.outputs.version }} + + publish: + needs: + - derive-version + - package + runs-on: ubuntu-latest + environment: release + steps: + - name: Download package artifacts + uses: actions/download-artifact@v4 + with: + name: nuget-packages + path: artifacts/nuget + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 10.0.x + + - name: Publish to NuGet + shell: bash + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + run: | + if [ -z "$NUGET_API_KEY" ]; then + echo "NUGET_API_KEY secret is required." >&2 + exit 1 + fi + + shopt -s nullglob + + for pkg in artifacts/nuget/*.nupkg; do + if [[ "$pkg" == *.snupkg ]]; then + continue + fi + dotnet nuget push "$pkg" \ + --source "https://api.nuget.org/v3/index.json" \ + --api-key "$NUGET_API_KEY" \ + --skip-duplicate + done + + for sym in artifacts/nuget/*.snupkg; do + dotnet nuget push "$sym" \ + --source "https://api.nuget.org/v3/index.json" \ + --api-key "$NUGET_API_KEY" \ + --skip-duplicate + done + + - name: Attach artifacts to GitHub release + uses: softprops/action-gh-release@v2 + with: + files: artifacts/nuget/* diff --git a/README.md b/README.md index 786ae68..50a458f 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ flowchart LR Supports plain completions, streaming, multi-turn conversations, **and tool / function calling** (compatible with `Microsoft.Agents.AI`). For a deeper look at the design, see [docs/architecture.md](docs/architecture.md). +For release automation and publishing steps, see [docs/releasing.md](docs/releasing.md). --- diff --git a/docs/releasing.md b/docs/releasing.md new file mode 100644 index 0000000..87c653c --- /dev/null +++ b/docs/releasing.md @@ -0,0 +1,38 @@ +# Releasing + +This repository ships three workflows: + +- `CI` (`.github/workflows/ci.yml`) for restore/build/test on push and pull request. +- `Package` (`.github/workflows/package.yml`) for building the native bridge and packing NuGet artifacts. +- `Release` (`.github/workflows/release.yml`) for tag-triggered publication to NuGet. + +## Tagging convention + +Release tags must start with `v` and the remainder is used as package version: + +- `v1.2.3` -> `1.2.3` +- `v1.2.3-preview1` -> `1.2.3-preview1` + +## Required repository configuration + +### Secrets + +- `NUGET_API_KEY` (repository or environment secret): API key with permission to publish `Community.Microsoft.Extensions.AI.CoreML` on NuGet.org. + +### Environment + +- Environment name: `release` (used by `release.yml`). +- Recommended: configure required reviewers on the `release` environment for gated production publishes. + +### Runner requirement + +The package/release flow requires an Apple Silicon macOS runner label: `macos-latest-xlarge`. + +## How to cut a release + +1. Ensure `CI` is green on `main`. +2. Create and push a tag using the release version format (`vX.Y.Z` or `vX.Y.Z-suffix`). +3. Wait for the `Release` workflow to finish. +4. Verify: + - NuGet package and symbols are published. + - Artifacts are attached to the GitHub release. diff --git a/src/Community.Microsoft.Extensions.AI.CoreML/Community.Microsoft.Extensions.AI.CoreML.csproj b/src/Community.Microsoft.Extensions.AI.CoreML/Community.Microsoft.Extensions.AI.CoreML.csproj index 15e0ba5..27ae5b0 100644 --- a/src/Community.Microsoft.Extensions.AI.CoreML/Community.Microsoft.Extensions.AI.CoreML.csproj +++ b/src/Community.Microsoft.Extensions.AI.CoreML/Community.Microsoft.Extensions.AI.CoreML.csproj @@ -11,7 +11,7 @@ Community.Microsoft.Extensions.AI.CoreML - 0.1.0-preview1 + 0.1.0-preview1 Frederiek Vandepitte and contributors Community An IChatClient implementation for Microsoft.Extensions.AI that calls Apple's on-device Foundation Models (Apple Intelligence) directly from .NET via P/Invoke. macOS 26+ on Apple Silicon. No MAUI, no HTTP server. From 8c3988e283a5e94aba723b94c4d1f199b2556852 Mon Sep 17 00:00:00 2001 From: Frederiek Vandepitte Date: Wed, 10 Jun 2026 13:07:16 +0200 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aca43e6..1d00e2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,9 @@ jobs: - name: Restore library run: dotnet restore src/Community.Microsoft.Extensions.AI.CoreML/Community.Microsoft.Extensions.AI.CoreML.csproj + - name: Restore tests + run: dotnet restore src/Community.Microsoft.Extensions.AI.CoreML.Tests/Community.Microsoft.Extensions.AI.CoreML.Tests.csproj + - name: Build library run: dotnet build src/Community.Microsoft.Extensions.AI.CoreML/Community.Microsoft.Extensions.AI.CoreML.csproj --configuration Release --no-restore