This document describes how to release packages for the Teams SDK for Python. It assumes you have required entitlements in Azure DevOps for triggering releases.
This project uses Nerdbank.GitVersioning for automatic version management.
The .NET SDK and nbgv CLI are required for publishing but optional for local development. Without them, packages fall back to version 0.0.0 so you can still build and test locally.
CI pipelines set NBGV_REQUIRED=1 to ensure builds fail if nbgv is unavailable.
# Optional for local dev, required for releases
dotnet tool install -g nbgv| Branch | Versions | Published |
|---|---|---|
main |
2.0.0.dev1, 2.0.0.dev2, ... |
No |
alpha/v2.0.0 |
2.0.0a10, 2.0.0a11, ... |
Yes |
release/v2.0.0 |
2.0.0 |
Yes |
Development happens on main. When ready to release, merge via PR:
main → alpha/v2.0.0 → release/v2.0.0
Each merge increments the version automatically.
Versions are managed by Nerdbank.GitVersioning via version.json.
{
"version": "2.0.0-dev.{height}",
"versionHeightOffset": 1
}Builds on main produce dev versions like 2.0.0.dev1, 2.0.0.dev2, etc. These are not published.
{
"version": "2.0.0-alpha.{height}",
"versionHeightOffset": 10
}Builds on alpha/v2.0.0 produce alpha versions like 2.0.0a10, 2.0.0a11, etc. These are published.
| Branch | Package Name |
|---|---|
alpha/v2.0.0 |
microsoft_teams_ai-2.0.0a11.tar.gz |
release/v2.0.0 |
microsoft_teams_ai-2.0.0.tar.gz |
Note: Running the pipeline on a branch not in
publicReleaseRefSpec(e.g., a feature branch) produces versions with the commit hash appended, like2.0.0a11.dev5+g1a2b3c4. This is expected and useful for testing.
To produce a stable release (e.g., 2.0.0 without any suffix):
- Create a
release/v2.0.0branch fromalpha/v2.0.0 - Update its
version.json:{ "version": "2.0.0", "versionHeightOffset": 1 } - Run the publish pipeline with Public to release to PyPI
When starting a new version (e.g., 2.1.0):
- Create
alpha/v2.1.0frommain - Update its
version.json:{ "version": "2.1.0-alpha.{height}", "versionHeightOffset": 1 } - Set up branch protection (require PRs)
The publish pipeline (.azdo/publish.yml) is manually triggered and requires selecting a Publish Type: Internal or Public.
- Go to Pipelines > teams.py in ADO
- Click Run pipeline
- Select the branch to build from (e.g.,
alpha/v2.0.0) - Choose a Publish Type:
- Internal — publishes unsigned packages to the Azure Artifacts
TeamsSDKPreviewsfeed. No approval required. Packages are available immediately. - Public — signs packages via ESRP and publishes to PyPI. Requires approval via the
teams-sdk-publishADO environment before the ESRP release proceeds.
- Internal — publishes unsigned packages to the Azure Artifacts
- Pipeline runs: Build > Test > Publish
Note: The
devtoolspackage is excluded from publishing. The pipeline filters out packages matching theExcludePackageFoldersvariable. Prerelease versions are taggednexton PyPI; stable versions are taggedlatest.
pip install microsoft-teams-ai==2.0.0a11The teams-sdk-publish environment in Azure DevOps controls who can approve public releases. To modify approvers:
- Go to Pipelines > Environments in ADO
- Select teams-sdk-publish
- Click the three dots menu > Approvals and checks
- Add/remove approvers as needed