Phase 10/13 — Build & Deploy

Phase 10: Build & Deploy

justfile orchestration, 4 build systems, CI/CD across 4 registries — the complete build, test, publish, and release pipeline for the Copilot SDK mono-repo.

1. Build Orchestration — justfile

The root justfile is the unified developer entry point for all cross-language operations.

Aggregate Commands

Source: justfile:6-12

format: format-go format-python format-nodejs format-dotnet
lint:   lint-go lint-python lint-nodejs lint-dotnet
test:   test-go test-python test-nodejs test-dotnet

Per-Language Commands

Task Go Python Node.js .NET
Format gofmt -w uv run ruff format npm run format (prettier) dotnet format
Lint golangci-lint run ruff check && ty check prettier --check && eslint && tsc --noEmit dotnet format --verify-no-changes
Test go test ./... uv run pytest npm test (vitest) dotnet test

Install All Dependencies

Source: justfile:74-82

install:
    cd nodejs && npm ci
    cd python && uv pip install -e ".[dev]"
    cd go && go mod download
    cd dotnet && dotnet restore
    cd test/harness && npm ci --ignore-scripts

Other Key Recipes

RecipePurpose
just scenario-buildBuilds all cross-language scenario samples
just validate-docsExtracts and validates documentation code examples
just playgroundInteractive SDK demo environment

2. Per-SDK Build Process

Per-SDK Build Process
flowchart TD
  subgraph nodejs["Node.js -- esbuild + tsc"]
    N1["Transpile: esbuild --> dist/ as ESM ES2022"] --> N2["Types: tsc generates .d.ts only"]
    N2 --> N3["Build: tsx esbuild-copilotsdk-nodejs.ts"]
    N3 --> N4["Test: vitest run"]
    N4 --> N5["Package: clean --> build --> set-version --> npm pack"]
  end
  subgraph python["Python -- setuptools + uv"]
    P1["Config: setuptools, wheel, setuptools_scm"] --> P2["Wheels: build-wheels.mjs\n6 platforms"]
  end
  subgraph golang["Go -- Standard Toolchain"]
    G1["Build: go build ./..."] --> G2["Test: go test ./... (Go 1.24)"]
    G2 --> G3["CLI bundler: go:embed directives\nfor compressed CLI binaries"]
  end
  subgraph dotnet[".NET -- MSBuild / dotnet CLI"]
    D1["Target: net8.0, AOT, C# 14"] --> D2["Version: _GenerateVersionProps\nextracts CLI version"]
    D2 --> D3["CLI download: fetches tarball\nfrom npm at build time"]
  end
          

3. Code Generation Pipeline

Source Schemas

From the @github/copilot npm package:

Source Schemas
flowchart LR
  A["session-events.schema.json\nAll session event types"] ~~~ B["api.schema.json\nAll RPC method signatures"]
          

Orchestration

Source: scripts/codegen/package.json:5-11

npm run generate = tsx typescript.ts && tsx csharp.ts && tsx python.ts && tsx go.ts

Codegen Tools

ToolPurpose
json-schema-to-typescriptJSON Schema → TypeScript interfaces
quicktype-coreMulti-language type generation (Python, Go)
Custom emitterC# records, enums, JSON converters

Generated Output

LanguageSession EventsRPC Types
TypeScript nodejs/src/generated/session-events.ts nodejs/src/generated/rpc.ts
Python python/copilot/generated/session_events.py python/copilot/generated/rpc.py
Go go/generated_session_events.go go/rpc/generated_rpc.go
C# dotnet/src/Generated/SessionEvents.cs dotnet/src/Generated/Rpc.cs

Protocol Version Generator

sdk-protocol-version.json → 4 constant files via nodejs/scripts/update-protocol-version.ts

4. CLI Bundling Strategy (per SDK)

CLI Bundling Strategy per SDK
flowchart LR
  subgraph nodejs["Node.js"]
    N["Direct npm dependency\nnpm handles platform binaries"]
  end
  subgraph python["Python"]
    P["build-wheels.mjs downloads\nplatform binaries from npm\nembeds in copilot/bin/"]
  end
  subgraph golang["Go"]
    G["cmd/bundler downloads binary\nzstd-compresses, generates\ngo:embed Go files"]
  end
  subgraph dotnet[".NET"]
    D["MSBuild targets download CLI\nat consumer build time\nfrom npm registry"]
  end
          

5. CI/CD Workflows

Per-SDK Test Workflows

3-OS matrix: Ubuntu, macOS, Windows

Per-SDK Test Workflows (3-OS matrix)
flowchart TD
  subgraph nodejs["nodejs-sdk-tests.yml"]
    N1["Trigger: push/PR to nodejs/**"] --> N2["prettier --> ESLint --> typecheck --> vitest"]
  end
  subgraph python["python-sdk-tests.yml"]
    P1["Trigger: push/PR to python/**"] --> P2["ruff format --> ruff lint --> ty check --> pytest"]
  end
  subgraph golang["go-sdk-tests.yml"]
    G1["Trigger: push/PR to go/**"] --> G2["gofmt --> golangci-lint --> go test"]
  end
  subgraph dotnet["dotnet-sdk-tests.yml"]
    D1["Trigger: push/PR to dotnet/**"] --> D2["dotnet format --> dotnet build --> dotnet test"]
  end
          

Cross-Cutting Workflows

WorkflowPurpose
codegen-check.ymlRe-runs codegen, verifies git status --porcelain is clean
scenario-builds.ymlBuild-verifies all scenario samples (4 parallel language jobs)
docs-validation.ymlExtracts code blocks from docs, validates per language

Agentic Workflows (AI-powered)

WorkflowPurpose
sdk-consistency-reviewReviews PRs for cross-SDK feature parity
issue-triageAuto-triages new issues
release-changelogGenerates changelogs from git history
cross-repo-issue-analysisLinks issues to upstream runtime repo

6. Publishing Pipeline (publish.yml)

Trigger: Manual workflow_dispatch with dist-tag (latest / prerelease / unstable) and optional version override.

Publishing Targets

RegistryPackageAuthCommand
npm @github/copilot-sdk OIDC npm publish --tag <tag> --access public
PyPI github-copilot-sdk Trusted publishing pypa/gh-action-pypi-publish
NuGet GitHub.Copilot.SDK OIDC via NuGet/login@v1 dotnet nuget push
Go modules github.com/github/copilot-sdk/go Git tag git tag go/v<version>

Publish Pipeline Flow

Publish Pipeline
flowchart TD
    A["Calculate Version\n(from CLI version)"] --> B["Publish to npm\n(@github/copilot-sdk)"]
    A --> C["Publish to PyPI\n(copilot-sdk)"]
    A --> D["Publish to Go proxy\n(pkg.go.dev)"]
    A --> E["Publish to NuGet\n(GitHub.Copilot.SDK)"]
    B --> F["Create GitHub Release\n+ tag"]
    C --> F
    D --> F
    E --> F
          
Note: .NET and Python publishing are skipped for the unstable dist-tag. Only npm always publishes.

7. Version Management

Single source of truth: nodejs/scripts/get-version.js

SDKHow Version Is Set
Node.js set-version.js writes to package.json
Python sed replaces version in pyproject.toml
.NET -p:Version=<ver> MSBuild property
Go Git tag go/v<version>

CLI Version Coupling

All SDKs derive CLI version from nodejs/package-lock.json:

CLI Version Derivation
flowchart TD
  A["nodejs/package-lock.json\nSingle source -- @github/copilot version"] --> B["Node.js\nDirect dependency"]
  A --> C["Python\nbuild-wheels.mjs reads lockfile"]
  A --> D["Go\nBundler fetches lockfile from GitHub"]
  A --> E[".NET\nMSBuild target extracts via node -e"]
          

8. Dependency Updates (dependabot.yaml)

Weekly schedule, grouped via multi-ecosystem-groups: all:

EcosystemDirectory
github-actions/
npm/nodejs, /test/harness
pip/python
gomod/go
nuget/dotnet
Manual CLI update: update-copilot-dependency.yml workflow bumps @github/copilot, re-runs codegen, and opens a PR.

9. Custom Actions

setup-copilot

Source: .github/actions/setup-copilot/action.yml

Composite action that:

setup-copilot Action Steps
flowchart TD
  A["1. Set up Node.js 22\nwith npm caching"] --> B["2. Run npm ci --ignore-scripts\nin nodejs/"]
  B --> C["3. Output CLI path\nnodejs/node_modules/@github/copilot/index.js"]
  C --> D["4. Verify CLI\nnode path --version"]
          

10. Build Artifacts

.tgz
Node.js — npm tarball
6 .whl
Python — platform wheels
.nupkg
.NET — NuGet package + .snupkg symbols
git tag
Go — go/v<version>
SDKArtifactFormat
Node.js npm tarball .tgz
Python 6 platform wheels .whl
.NET NuGet package + symbols .nupkg + .snupkg
Go Git tag go/v<version>