Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/skills/bump-and-release/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
name: bump-and-release
description: Bump dependency "@typespec/http-client-python" and release new versions for Azure/autorest.python repo. Use when user wants to bump, update, or upgrade the @typespec/http-client-python dependency, create a release PR, or publish new versions of autorest.python and typespec-python packages.
---

# Bump and Release

Bump the "@typespec/http-client-python" dependency and create a release PR for the Azure/autorest.python repository.

## Context Variables

- **BASE_BRANCH**: The branch to base changes on (default: "main")
- **CURRENT_DATE**: Current date in YYYY-MM-DD format (e.g., "2025-01-01")

## Workflow

### Step 1: Prepare Branch

Navigate to the root folder of "Azure/autorest.python" repo.

**If BASE_BRANCH is "main":**
```bash
git reset HEAD && git checkout . && git checkout origin/main && git pull origin main && git checkout -b publish/release-{{CURRENT_DATE}}
```

**If BASE_BRANCH is not "main":**
```bash
git reset HEAD && git checkout . && git fetch origin {{BASE_BRANCH}} && git checkout {{BASE_BRANCH}}
```

### Step 2: Get Latest Version and Update Dependencies

1. Get the latest VERSION of "@typespec/http-client-python" from npm:
```bash
npm view @typespec/http-client-python version
```

2. Update the version of "@typespec/http-client-python" to `~{{VERSION}}` in both files:
- `packages/autorest.python/package.json`
- `packages/typespec-python/package.json`

### Step 3: Run Version Tool

Run the change version command:
```bash
pnpm change version
```

Verify at least 4 files are changed:
- `packages/autorest.python/package.json`
- `packages/autorest.python/CHANGELOG.md`
- `packages/typespec-python/package.json`
- `packages/typespec-python/CHANGELOG.md`

### Step 4: Check for Minor Version Bump

The version tool calculates the next version but may choose patch instead of minor incorrectly.

1. Run `git diff` to inspect updated CHANGELOG.md files
2. If any CHANGELOG.md contains "### Features", upgrade to minor version instead of patch version
3. Update version numbers in all 4 files:
- `packages/autorest.python/package.json`
- `packages/autorest.python/CHANGELOG.md`
- `packages/typespec-python/package.json`
- `packages/typespec-python/CHANGELOG.md`

### Step 5: Build and Stage

```bash
pnpm install && pnpm build && git add -u
```

### Step 6: Commit and Push

```bash
git commit -m "bump version"
git push origin HEAD
```

### Step 7: Create PR

If no existing PR exists for the current branch, create a new pull request targeting the BASE_BRANCH.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ pnpm clean

**Semi-auto:**

Branch `publish/auto-release` should be automatically updated with the latest changelog. Give it 5min after merging a PR or check the status of the [Release action](https://github.com/Azure/autorest.python/actions/workflows/prepare-auto-release-branch.yml)

Then go to https://github.com/Azure/autorest.python/pull/new/publish/auto-release and create this PR.
Follow https://github.com/Azure/autorest.python/blob/main/.github/skills/bump-and-release/SKILL.md to make a release PR.
After it merged, trigger [release pipeline](https://dev.azure.com/azure-sdk/internal/_build?definitionId=1668) to release new version.

## Contributing

Expand Down
Loading