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-gofolder. - Run
ncu -uonpackage.jsonto 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
peerDependenciesofpackage.jsonto match the upgraded versions. For each upgraded package that also appears inpeerDependencies, 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 tspcompilefails 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 tspcompilemust 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 diffto 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.jsonto 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.
Source: Azure/autorest.go — distributed by TomeVault.