Skip to content
Open
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
3 changes: 3 additions & 0 deletions .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.2.0"
}
24 changes: 24 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "python",
"package-name": "google-adk-community",
"draft": true,
"changelog-path": "CHANGELOG.md",
"skip-github-release": false,
"changelog-sections": [
{"type": "feat", "section": "Features"},
{"type": "fix", "section": "Bug Fixes"},
{"type": "perf", "section": "Performance Improvements"},
{"type": "refactor", "section": "Code Refactoring"},
{"type": "docs", "section": "Documentation"},
{"type": "test", "section": "Tests", "hidden": true},
{"type": "build", "section": "Build System", "hidden": true},
{"type": "ci", "section": "CI/CD", "hidden": true},
{"type": "style", "section": "Styles", "hidden": true},
{"type": "chore", "section": "Miscellaneous Chores", "hidden": true}
]
}
}
}
72 changes: 72 additions & 0 deletions .github/workflows/cut-release-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Cut Release Branch

on:
workflow_dispatch:
inputs:
version:
description: 'Version for the release (e.g., 0.3.0)'
required: true
type: string

permissions:
contents: write

jobs:
cut-branch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0

- name: Validate version format
run: |
if ! echo "${{ inputs.version }}" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "Error: Version must be in format X.Y.Z (e.g., 0.3.0)"
exit 1
fi

- name: Create release branch
run: |
BRANCH_NAME="release/v${{ inputs.version }}"
git checkout -b "$BRANCH_NAME"
echo "Created branch: $BRANCH_NAME"

- name: Bump version
run: |
# Update version.py
sed -i 's/__version__ = ".*"/__version__ = "${{ inputs.version }}"/' src/google/adk_community/version.py

# Update release-please manifest
echo '{".": "${{ inputs.version }}"}' > .github/.release-please-manifest.json

echo "Bumped version to ${{ inputs.version }}"

- name: Commit version bump
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add src/google/adk_community/version.py .github/.release-please-manifest.json
git commit -m "chore: bump version to ${{ inputs.version }}"
git push origin "release/v${{ inputs.version }}"

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Build wheel
run: uv build

- name: Upload wheel for testing
uses: actions/upload-artifact@v4
with:
name: dist-${{ inputs.version }}
path: dist/
retention-days: 30
34 changes: 34 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish to PyPI

on:
release:
types: [published]

permissions:
contents: read

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Build package
run: uv build

- name: Publish to PyPI
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: uv publish
33 changes: 33 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release Please

on:
push:
branches:
- 'release/**'

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- name: Extract version from branch name
id: extract-version
run: |
# Branch name is like "release/v0.3.0", extract "0.3.0"
VERSION="${GITHUB_REF_NAME#release/v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"

- uses: googleapis/release-please-action@v4
id: release
with:
config-file: .github/release-please-config.json
manifest-file: .github/.release-please-manifest.json
target-branch: ${{ github.ref_name }}
release-as: ${{ steps.extract-version.outputs.version }}