You've already forked adk-python
mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b0610cac8e | |||
| 97542097c9 | |||
| 0bd06c09aa | |||
| 313b042b69 | |||
| e5e15a807e | |||
| 20590deb81 | |||
| dc17c8501c |
@@ -1,3 +0,0 @@
|
||||
{
|
||||
".": "1.26.0"
|
||||
}
|
||||
@@ -7,69 +7,34 @@ assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## đź”´ Required Information
|
||||
*Please ensure all items in this section are completed to allow for efficient
|
||||
triaging. Requests without complete information may be rejected / deprioritized.
|
||||
If an item is not applicable to you - please mark it as N/A*
|
||||
** Please make sure you read the contribution guide and file the issues in the right place. **
|
||||
[Contribution guide.](https://google.github.io/adk-docs/contributing-guide/)
|
||||
|
||||
**Describe the Bug:**
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**Steps to Reproduce:**
|
||||
Please provide a numbered list of steps to reproduce the behavior:
|
||||
**To Reproduce**
|
||||
Please share a minimal code and data to reproduce your problem.
|
||||
Steps to reproduce the behavior:
|
||||
1. Install '...'
|
||||
2. Run '....'
|
||||
3. Open '....'
|
||||
4. Provide error or stacktrace
|
||||
|
||||
**Expected Behavior:**
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Observed Behavior:**
|
||||
What actually happened? Include error messages or crash stack traces here.
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Environment Details:**
|
||||
|
||||
- ADK Library Version (pip show google-adk):
|
||||
- Desktop OS:** [e.g., macOS, Linux, Windows]
|
||||
- Python Version (python -V):
|
||||
|
||||
**Model Information:**
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. macOS, Linux, Windows]
|
||||
- Python version(python -V):
|
||||
- ADK version(pip show google-adk):
|
||||
|
||||
**Model Information:**
|
||||
- Are you using LiteLLM: Yes/No
|
||||
- Which model is being used: (e.g., gemini-2.5-pro)
|
||||
- Which model is being used(e.g. gemini-2.5-pro)
|
||||
|
||||
---
|
||||
|
||||
## 🟡 Optional Information
|
||||
*Providing this information greatly speeds up the resolution process.*
|
||||
|
||||
**Regression:**
|
||||
Did this work in a previous version of ADK? If so, which one?
|
||||
|
||||
**Logs:**
|
||||
Please attach relevant logs. Wrap them in code blocks (```) or attach a
|
||||
text file.
|
||||
```text
|
||||
// Paste logs here
|
||||
```
|
||||
|
||||
**Screenshots / Video:**
|
||||
If applicable, add screenshots or screen recordings to help explain
|
||||
your problem.
|
||||
|
||||
**Additional Context:**
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
|
||||
**Minimal Reproduction Code:**
|
||||
Please provide a code snippet or a link to a Gist/repo that isolates the issue.
|
||||
```python
|
||||
// Code snippet here
|
||||
```
|
||||
|
||||
**How often has this issue occurred?:**
|
||||
|
||||
- Always (100%)
|
||||
- Often (50%+)
|
||||
- Intermittently (<50%)
|
||||
- Once / Rare
|
||||
|
||||
@@ -10,39 +10,14 @@ assignees: ''
|
||||
** Please make sure you read the contribution guide and file the issues in the right place. **
|
||||
[Contribution guide.](https://google.github.io/adk-docs/contributing-guide/)
|
||||
|
||||
## đź”´ Required Information
|
||||
*Please ensure all items in this section are completed to allow for efficient
|
||||
triaging. Requests without complete information may be rejected / deprioritized.
|
||||
If an item is not applicable to you - please mark it as N/A*
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
### Is your feature request related to a specific problem?
|
||||
Please describe the problem you are trying to solve. (Ex: "I'm always frustrated
|
||||
when I have to manually handle X...")
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
### Describe the Solution You'd Like
|
||||
A clear and concise description of the feature or API change you want.
|
||||
Be specific about input/outputs if this involves an API change.
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
### Impact on your work
|
||||
How does this feature impact your work and what are you trying to achieve?
|
||||
If this is critical for you, tell us if there is a timeline by when you need
|
||||
this feature.
|
||||
|
||||
### Willingness to contribute
|
||||
Are you interested in implementing this feature yourself or submitting a PR?
|
||||
(Yes/No)
|
||||
|
||||
---
|
||||
|
||||
## 🟡 Recommended Information
|
||||
|
||||
### Describe Alternatives You've Considered
|
||||
A clear and concise description of any alternative solutions or workarounds
|
||||
you've considered and why they didn't work for you.
|
||||
|
||||
### Proposed API / Implementation
|
||||
If you have ideas on how this should look in code, please share a
|
||||
pseudo-code example.
|
||||
|
||||
### Additional Context
|
||||
Add any other context or screenshots about the feature request here.
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
|
||||
"last-release-sha": "8f5428150d18ed732b66379c0acb806a9121c3cb",
|
||||
"packages": {
|
||||
".": {
|
||||
"release-type": "python",
|
||||
"versioning": "always-bump-minor",
|
||||
"package-name": "google-adk",
|
||||
"include-component-in-tag": false,
|
||||
"skip-github-release": true,
|
||||
"changelog-path": "CHANGELOG.md",
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
releaseType: python
|
||||
handleGHRelease: true
|
||||
bumpMinorPreMajor: false
|
||||
extraFiles:
|
||||
- src/google/adk/version.py
|
||||
@@ -0,0 +1 @@
|
||||
enabled: true
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Load adk-bot SSH Private Key
|
||||
uses: webfactory/ssh-agent@v0.9.1
|
||||
uses: webfactory/ssh-agent@v0.9.0
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.ADK_BOT_SSH_PRIVATE_KEY }}
|
||||
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
name: Breaking Change Detector
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'src/**'
|
||||
|
||||
jobs:
|
||||
check-api:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Required for accessing the main branch history
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Install the latest version of uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
|
||||
- name: Install dependencies
|
||||
# Syncing installs the package and its dependencies (populating google.* namespace)
|
||||
# Installing 'griffe' ensures the tool is available in the environment
|
||||
run: |
|
||||
uv sync --extra test
|
||||
uv pip install griffe
|
||||
|
||||
- name: Run Breaking Change Detection
|
||||
# Uses 'uv run python' to execute in the environment with all dependencies installed
|
||||
run: |
|
||||
uv run python - <<EOF
|
||||
import sys
|
||||
import griffe
|
||||
from griffe import find_breaking_changes, load, load_git
|
||||
|
||||
def check_return_types(old_obj, new_obj):
|
||||
"""Custom check to strictly compare return type annotations."""
|
||||
errors = []
|
||||
# Check Runner.run specifically, or extend to check all methods
|
||||
try:
|
||||
old_run = old_obj.members["Runner"].members["run"]
|
||||
new_run = new_obj.members["Runner"].members["run"]
|
||||
|
||||
# Convert to string and strip to compare the annotation text
|
||||
old_ret = str(old_run.returns).strip()
|
||||
new_ret = str(new_run.returns).strip()
|
||||
|
||||
if old_ret != new_ret:
|
||||
errors.append(
|
||||
f"Breaking Change in {new_run.path}: Return type changed from '{old_ret}' to '{new_ret}'"
|
||||
)
|
||||
except KeyError:
|
||||
pass # Member missing (will be caught by standard checks)
|
||||
except AttributeError:
|
||||
pass # Member might not be a function
|
||||
return errors
|
||||
|
||||
try:
|
||||
print("Loading new API (from local source)...")
|
||||
# allow_inspection=False forces static analysis, preventing sys.modules caching issues
|
||||
new_api = load("google.adk", search_paths=["src"], allow_inspection=False)
|
||||
|
||||
print("Loading baseline API (from main branch)...")
|
||||
old_api = load_git("google.adk", ref="main", search_paths=["src"], allow_inspection=False)
|
||||
|
||||
print("Running detection...")
|
||||
|
||||
# 1. Standard Griffe Checks (Removals, Parameter changes)
|
||||
breakages = list(find_breaking_changes(old_api, new_api))
|
||||
|
||||
# 2. Custom Return Type Checks (Workaround for Griffe limitation)
|
||||
custom_errors = check_return_types(old_api, new_api)
|
||||
|
||||
found_issues = False
|
||||
|
||||
if breakages:
|
||||
found_issues = True
|
||||
print(f"::error::Found {len(breakages)} standard breaking changes!")
|
||||
for breakage in breakages:
|
||||
print(breakage.explain())
|
||||
|
||||
if custom_errors:
|
||||
found_issues = True
|
||||
print(f"::error::Found {len(custom_errors)} return type mismatches!")
|
||||
for error in custom_errors:
|
||||
print(f"- {error}")
|
||||
|
||||
if found_issues:
|
||||
sys.exit(1)
|
||||
|
||||
print("Success: No breaking changes detected.")
|
||||
|
||||
except Exception as e:
|
||||
print(f"::error::Breaking change detection failed: {e}")
|
||||
sys.exit(1)
|
||||
EOF
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2026 Google LLC
|
||||
# Copyright 2025 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -30,8 +30,8 @@ jobs:
|
||||
|
||||
- name: Check for logger pattern in all changed Python files
|
||||
run: |
|
||||
git fetch origin ${GITHUB_BASE_REF}
|
||||
CHANGED_FILES=$(git diff --diff-filter=ACMR --name-only origin/${GITHUB_BASE_REF}...HEAD | grep -E '\.py$' || true)
|
||||
git fetch origin ${{ github.base_ref }}
|
||||
CHANGED_FILES=$(git diff --diff-filter=ACMR --name-only origin/${{ github.base_ref }}...HEAD | grep -E '\.py$' || true)
|
||||
if [ -n "$CHANGED_FILES" ]; then
|
||||
echo "Changed Python files to check:"
|
||||
echo "$CHANGED_FILES"
|
||||
@@ -61,8 +61,8 @@ jobs:
|
||||
|
||||
- name: Check for import pattern in certain changed Python files
|
||||
run: |
|
||||
git fetch origin ${GITHUB_BASE_REF}
|
||||
CHANGED_FILES=$(git diff --diff-filter=ACMR --name-only origin/${GITHUB_BASE_REF}...HEAD | grep -E '\.py$' | grep -v -E '__init__.py$|version.py$|tests/.*|contributing/samples/' || true)
|
||||
git fetch origin ${{ github.base_ref }}
|
||||
CHANGED_FILES=$(git diff --diff-filter=ACMR --name-only origin/${{ github.base_ref }}...HEAD | grep -E '\.py$' | grep -v -E '__init__.py$|version.py$|tests/.*|contributing/samples/' || true)
|
||||
if [ -n "$CHANGED_FILES" ]; then
|
||||
echo "Changed Python files to check:"
|
||||
echo "$CHANGED_FILES"
|
||||
@@ -88,15 +88,15 @@ jobs:
|
||||
|
||||
- name: Check for import from cli package in certain changed Python files
|
||||
run: |
|
||||
git fetch origin ${GITHUB_BASE_REF}
|
||||
CHANGED_FILES=$(git diff --diff-filter=ACMR --name-only origin/${GITHUB_BASE_REF}...HEAD | grep -E '\.py$' | grep -v -E 'cli/.*|src/google/adk/tools/apihub_tool/apihub_toolset.py|tests/.*|contributing/samples/' || true)
|
||||
git fetch origin ${{ github.base_ref }}
|
||||
CHANGED_FILES=$(git diff --diff-filter=ACMR --name-only origin/${{ github.base_ref }}...HEAD | grep -E '\.py$' | grep -v -E 'cli/.*|src/google/adk/tools/apihub_tool/apihub_toolset.py|tests/.*|contributing/samples/' || true)
|
||||
if [ -n "$CHANGED_FILES" ]; then
|
||||
echo "Changed Python files to check:"
|
||||
echo "$CHANGED_FILES"
|
||||
echo ""
|
||||
|
||||
set +e
|
||||
FILES_WITH_FORBIDDEN_IMPORT=$(grep -lE '^from.*\bcli\b.*import.*$' $CHANGED_FILES)
|
||||
FILES_WITH_FORBIDDEN_IMPORT=$(grep -lE '^from.*cli.*import.*$' $CHANGED_FILES)
|
||||
GREP_EXIT_CODE=$?
|
||||
set -e
|
||||
|
||||
@@ -110,4 +110,4 @@ jobs:
|
||||
fi
|
||||
else
|
||||
echo "âś… No relevant Python files found."
|
||||
fi
|
||||
fi
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2026 Google LLC
|
||||
# Copyright 2025 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.11'
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install isort
|
||||
run: |
|
||||
@@ -42,8 +42,8 @@ jobs:
|
||||
- name: Run isort on changed files
|
||||
id: run_isort
|
||||
run: |
|
||||
git fetch origin ${GITHUB_BASE_REF}
|
||||
CHANGED_FILES=$(git diff --diff-filter=ACMR --name-only origin/${GITHUB_BASE_REF}...HEAD | grep -E '\.py$' || true)
|
||||
git fetch origin ${{ github.base_ref }}
|
||||
CHANGED_FILES=$(git diff --diff-filter=ACMR --name-only origin/${{ github.base_ref }}...HEAD | grep -E '\.py$' || true)
|
||||
if [ -n "$CHANGED_FILES" ]; then
|
||||
echo "Changed Python files:"
|
||||
echo "$CHANGED_FILES"
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
name: Mypy New Error Check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
|
||||
jobs:
|
||||
mypy-diff:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13',]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
|
||||
- name: Generate Baseline (Main)
|
||||
run: |
|
||||
# Switch to main branch to generate baseline
|
||||
git checkout origin/main
|
||||
|
||||
git checkout ${{ github.sha }} -- pyproject.toml
|
||||
|
||||
# Install dependencies for main
|
||||
uv venv .venv
|
||||
source .venv/bin/activate
|
||||
uv sync --all-extras
|
||||
|
||||
# Run mypy, filter for errors only, remove line numbers (file:123: -> file::), and sort
|
||||
# We ignore exit code (|| true) because we expect errors on main
|
||||
uv run mypy . | grep "error:" | sed 's/:\([0-9]\+\):/::/g' | sort > main_errors.txt || true
|
||||
|
||||
echo "Found $(wc -l < main_errors.txt) errors on main."
|
||||
|
||||
- name: Check PR Branch
|
||||
run: |
|
||||
# Switch back to the PR commit
|
||||
git checkout ${{ github.sha }}
|
||||
|
||||
# Re-sync dependencies in case the PR changed them
|
||||
source .venv/bin/activate
|
||||
uv sync --all-extras
|
||||
|
||||
# Run mypy on PR code, apply same processing
|
||||
uv run mypy . | grep "error:" | sed 's/:\([0-9]\+\):/::/g' | sort > pr_errors.txt || true
|
||||
|
||||
echo "Found $(wc -l < pr_errors.txt) errors on PR branch."
|
||||
|
||||
- name: Compare and Fail on New Errors
|
||||
run: |
|
||||
# 'comm -13' suppresses unique lines in file1 (main) and common lines,
|
||||
# leaving only lines unique to file2 (PR) -> The new errors.
|
||||
comm -13 main_errors.txt pr_errors.txt > new_errors.txt
|
||||
|
||||
if [ -s new_errors.txt ]; then
|
||||
echo "::error::The following NEW mypy errors were introduced:"
|
||||
cat new_errors.txt
|
||||
exit 1
|
||||
else
|
||||
echo "Great job! No new mypy errors introduced."
|
||||
fi
|
||||
@@ -1,29 +0,0 @@
|
||||
name: Mypy Type Check
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
mypy:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13',]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-extras
|
||||
|
||||
- name: Run mypy
|
||||
|
||||
run: uv run mypy . --strict
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2026 Google LLC
|
||||
# Copyright 2025 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.11'
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install pyink
|
||||
run: |
|
||||
@@ -42,8 +42,8 @@ jobs:
|
||||
- name: Run pyink on changed files
|
||||
id: run_pyink
|
||||
run: |
|
||||
git fetch origin ${GITHUB_BASE_REF}
|
||||
CHANGED_FILES=$(git diff --diff-filter=ACMR --name-only origin/${GITHUB_BASE_REF}...HEAD | grep -E '\.py$' || true)
|
||||
git fetch origin ${{ github.base_ref }}
|
||||
CHANGED_FILES=$(git diff --diff-filter=ACMR --name-only origin/${{ github.base_ref }}...HEAD | grep -E '\.py$' || true)
|
||||
if [ -n "$CHANGED_FILES" ]; then
|
||||
echo "Changed Python files:"
|
||||
echo "$CHANGED_FILES"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2026 Google LLC
|
||||
# Copyright 2025 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
||||
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -37,13 +37,13 @@ jobs:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install the latest version of uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
uses: astral-sh/setup-uv@v6
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
uv venv .venv
|
||||
source .venv/bin/activate
|
||||
uv sync --extra test
|
||||
uv sync --extra test --extra eval --extra a2a
|
||||
|
||||
- name: Run unit tests with pytest
|
||||
run: |
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
# Step 3 (optional): Cherry-picks a commit from main to the release/candidate branch.
|
||||
# Use between step 1 and step 4 to include bug fixes in an in-progress release.
|
||||
# Note: Does NOT auto-trigger release-please to preserve manual changelog edits.
|
||||
name: "Release: Cherry-pick"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
commit_sha:
|
||||
description: 'Commit SHA to cherry-pick'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
cherry-pick:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: release/candidate
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Cherry-pick commit
|
||||
run: |
|
||||
echo "Cherry-picking ${INPUTS_COMMIT_SHA} to release/candidate"
|
||||
git cherry-pick ${INPUTS_COMMIT_SHA}
|
||||
env:
|
||||
INPUTS_COMMIT_SHA: ${{ inputs.commit_sha }}
|
||||
|
||||
- name: Push changes
|
||||
run: |
|
||||
git push origin release/candidate
|
||||
echo "Successfully cherry-picked commit to release/candidate"
|
||||
echo "Note: Release Please is NOT auto-triggered to preserve manual changelog edits."
|
||||
echo "Run release-please.yml manually if you want to regenerate the changelog."
|
||||
@@ -1,46 +0,0 @@
|
||||
# Step 1: Starts the release process by creating a release/candidate branch.
|
||||
# Generates a changelog PR for review (step 2).
|
||||
name: "Release: Cut"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
commit_sha:
|
||||
description: 'Commit SHA to cut from (leave empty for latest main)'
|
||||
required: false
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
cut-release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.commit_sha || 'main' }}
|
||||
|
||||
- name: Check for existing release/candidate branch
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
if git ls-remote --exit-code --heads origin release/candidate &>/dev/null; then
|
||||
echo "Error: release/candidate branch already exists"
|
||||
echo "Please finalize or delete the existing release candidate before starting a new one"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Create and push release/candidate branch
|
||||
run: |
|
||||
git checkout -b release/candidate
|
||||
git push origin release/candidate
|
||||
echo "Created branch: release/candidate"
|
||||
|
||||
- name: Trigger Release Please
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh workflow run release-please.yml --repo ${{ github.repository }} --ref release/candidate
|
||||
echo "Triggered Release Please workflow"
|
||||
@@ -1,85 +0,0 @@
|
||||
# Step 4: Triggers when the changelog PR is merged to release/candidate.
|
||||
# Records last-release-sha and renames release/candidate to release/v{version}.
|
||||
name: "Release: Finalize"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
branches:
|
||||
- release/candidate
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
finalize:
|
||||
if: github.event.pull_request.merged == true
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check for release-please PR
|
||||
id: check
|
||||
env:
|
||||
LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
|
||||
run: |
|
||||
if echo "$LABELS" | grep -q "autorelease: pending"; then
|
||||
echo "is_release_pr=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "Not a release-please PR, skipping"
|
||||
echo "is_release_pr=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
if: steps.check.outputs.is_release_pr == 'true'
|
||||
with:
|
||||
ref: release/candidate
|
||||
token: ${{ secrets.RELEASE_PAT }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Extract version from manifest
|
||||
if: steps.check.outputs.is_release_pr == 'true'
|
||||
id: version
|
||||
run: |
|
||||
VERSION=$(jq -r '.["."]' .github/.release-please-manifest.json)
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Extracted version: $VERSION"
|
||||
|
||||
- name: Configure git identity from RELEASE_PAT
|
||||
if: steps.check.outputs.is_release_pr == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
|
||||
run: |
|
||||
USER_JSON=$(gh api user)
|
||||
git config user.name "$(echo "$USER_JSON" | jq -r '.login')"
|
||||
git config user.email "$(echo "$USER_JSON" | jq -r '.id')+$(echo "$USER_JSON" | jq -r '.login')@users.noreply.github.com"
|
||||
|
||||
- name: Record last-release-sha for release-please
|
||||
if: steps.check.outputs.is_release_pr == 'true'
|
||||
run: |
|
||||
git fetch origin main
|
||||
CUT_SHA=$(git merge-base origin/main HEAD)
|
||||
echo "Release was cut from main at: $CUT_SHA"
|
||||
jq --arg sha "$CUT_SHA" '. + {"last-release-sha": $sha}' \
|
||||
.github/release-please-config.json > tmp.json && mv tmp.json .github/release-please-config.json
|
||||
git add .github/release-please-config.json
|
||||
git commit -m "chore: update last-release-sha for next release"
|
||||
git push origin release/candidate
|
||||
|
||||
- name: Rename release/candidate to release/v{version}
|
||||
if: steps.check.outputs.is_release_pr == 'true'
|
||||
run: |
|
||||
VERSION="v${STEPS_VERSION_OUTPUTS_VERSION}"
|
||||
git push origin "release/candidate:refs/heads/release/$VERSION" ":release/candidate"
|
||||
echo "Renamed release/candidate to release/$VERSION"
|
||||
env:
|
||||
STEPS_VERSION_OUTPUTS_VERSION: ${{ steps.version.outputs.version }}
|
||||
|
||||
- name: Update PR label to tagged
|
||||
if: steps.check.outputs.is_release_pr == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh pr edit ${{ github.event.pull_request.number }} \
|
||||
--remove-label "autorelease: pending" \
|
||||
--add-label "autorelease: tagged"
|
||||
echo "Updated PR label to autorelease: tagged"
|
||||
@@ -1,41 +0,0 @@
|
||||
# Runs release-please to create/update a PR with version bump and changelog.
|
||||
# Triggered only by workflow_dispatch (from release-cut.yml).
|
||||
# Does NOT auto-run on push to preserve manual changelog edits after cherry-picks.
|
||||
name: "Release: Please"
|
||||
|
||||
on:
|
||||
# Only run via workflow_dispatch (triggered by release-cut.yml)
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
release-please:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if release/candidate still exists
|
||||
id: check
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
if gh api repos/${{ github.repository }}/branches/release/candidate --silent 2>/dev/null; then
|
||||
echo "exists=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "release/candidate branch no longer exists, skipping"
|
||||
echo "exists=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
if: steps.check.outputs.exists == 'true'
|
||||
with:
|
||||
ref: release/candidate
|
||||
|
||||
- uses: googleapis/release-please-action@v4
|
||||
if: steps.check.outputs.exists == 'true'
|
||||
with:
|
||||
token: ${{ secrets.RELEASE_PAT }}
|
||||
config-file: .github/release-please-config.json
|
||||
manifest-file: .github/.release-please-manifest.json
|
||||
target-branch: release/candidate
|
||||
@@ -1,60 +0,0 @@
|
||||
# Step 6: Builds and publishes the package to PyPI from a release/v{version} branch.
|
||||
# Creates a merge-back PR (step 7) to sync release changes to main.
|
||||
name: "Release: Publish to PyPi"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Validate branch
|
||||
run: |
|
||||
if [[ ! "${GITHUB_REF_NAME}" =~ ^release/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "Error: Must run from a release/v* branch (e.g., release/v0.3.0)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Extract version
|
||||
id: version
|
||||
run: |
|
||||
VERSION="${GITHUB_REF_NAME}"
|
||||
VERSION="${VERSION#release/v}"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Publishing version: $VERSION"
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- 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
|
||||
|
||||
- name: Create merge-back PR
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
|
||||
STEPS_VERSION_OUTPUTS_VERSION: ${{ steps.version.outputs.version }}
|
||||
run: |
|
||||
gh pr create \
|
||||
--base main \
|
||||
--head "${GITHUB_REF_NAME}" \
|
||||
--title "chore: merge release v${STEPS_VERSION_OUTPUTS_VERSION} to main" \
|
||||
--body "Syncs version bump and CHANGELOG from release v${STEPS_VERSION_OUTPUTS_VERSION} to main."
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2026 Google LLC
|
||||
# Copyright 2025 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -23,7 +23,6 @@ on:
|
||||
|
||||
jobs:
|
||||
audit-stale-issues:
|
||||
if: github.repository == 'google/adk-python'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user