| name | typespec-go-bump-and-release |
| description | Upgrade tsp toolset dependencies for the @azure-tools/typespec-go package in Azure/autorest.go repo. Use when user wants to bump, update, or upgrade the TypeSpec toolset dependencies (e.g., @typespec/compiler, @typespec/http, @azure-tools/typespec-client-generator-core, @azure-tools/azure-http-specs), create a release PR, or publish a new version of typespec-go. |
TypeSpec Go Bump and Release
Upgrade the TypeSpec toolset dependencies for @azure-tools/typespec-go and create a release PR for the Azure/autorest.go repository.
Context Variables
- CURRENT_DATE: Current date in YYYY-MM-DD format (e.g., "2025-01-01")
Workflow
Step 1: Check and Upgrade TypeSpec Dependencies
- Change work directory to
packages/typespec-go folder.
- Run
ncu -u on package.json to check if there are any TypeSpec-related packages that need upgrading. Focus on packages matching:
@typespec/*
@azure-tools/typespec-*
@azure-tools/azure-http-specs
- Review the proposed upgrades and apply them.
- Check and update the corresponding versions in
peerDependencies of package.json to match the upgraded versions. For each upgraded package that also appears in peerDependencies, update its version range accordingly.
Step 2: Install and Build
Run pnpm install from the repo root, and then run pnpm build from the packages/typespec-go directory:
cd <repo-root>
pnpm install
cd packages/typespec-go
pnpm build
This ensures pnpm-lock.yaml is updated and the project builds correctly.
Step 3: Run TypeSpec Compile
From the packages/typespec-go directory, run:
pnpm tspcompile
Notes:
- This command needs several minutes to finish; wait until it completes.
- If
pnpm tspcompile fails with any errors, stop immediately and report the error to the user. Do not proceed to subsequent steps until the error is resolved.
- All changed files after
pnpm tspcompile must be committed.
Step 4: Update CHANGELOG.md
Update packages/typespec-go/CHANGELOG.md with a new entry. The format should be:
## x.x.x ({{CURRENT_DATE}})
### Other Changes
* Updated to the latest tsp toolset.
Version rules:
- Run
git diff to inspect the changes.
- The emitter is currently v0.x.x, semver rules are shifted: bump minor for breaking changes, patch for features/fixes/other.
- If there is already an unreleased version entry at the top, append the changelog entry into that existing version instead of creating a new one.
- Update the version in
packages/typespec-go/package.json to match.
Step 5: Stage, Commit and Push
git add -A && git commit -m "upgrade tsp toolset" && git push origin HEAD
Step 6: Create PR
If no existing PR exists for the current branch, create a new pull request targeting the main branch.