Skip to content

Commit 446575f

Browse files
GWealecopybara-github
authored andcommitted
fix: Update v2 release workflow to be dispatched from v2 branch
The workflow now accepts a `release_branch` input, checks out the specified release branch, and updates the version in `src/google/adk/version.py` Co-authored-by: George Weale <gweale@google.com> PiperOrigin-RevId: 890134954
1 parent 5f69e19 commit 446575f

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

.github/workflows/release-v2-publish.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Step 6 (v2): Builds and publishes the v2 package to PyPI from a release/v{version} branch.
2-
# Converts semver pre-release version to PEP 440 format before building.
2+
# Reads version from .release-please-manifest-v2.json, converts to PEP 440,
3+
# updates version.py, then builds and publishes.
34
# Creates a merge-back PR (step 7) to sync release changes to v2.
45
name: "Release v2: Publish to PyPi"
56

@@ -17,15 +18,16 @@ jobs:
1718
- name: Validate branch
1819
run: |
1920
if [[ ! "${GITHUB_REF_NAME}" =~ ^release/v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
20-
echo "Error: Must run from a release/v* branch (e.g., release/v2.0.0-alpha.1)"
21+
echo "Error: Must run from a release/v* branch (e.g., release/v2.0.0-alpha.2)"
2122
exit 1
2223
fi
2324
24-
- name: Extract and convert version to PEP 440
25+
- uses: actions/checkout@v6
26+
27+
- name: Extract version from manifest and convert to PEP 440
2528
id: version
2629
run: |
27-
VERSION="${GITHUB_REF_NAME}"
28-
VERSION="${VERSION#release/v}"
30+
VERSION=$(jq -r '.["."]' .github/.release-please-manifest-v2.json)
2931
echo "semver=$VERSION" >> $GITHUB_OUTPUT
3032
echo "Semver version: $VERSION"
3133
@@ -38,8 +40,6 @@ jobs:
3840
echo "pep440=$PEP440" >> $GITHUB_OUTPUT
3941
echo "PEP 440 version: $PEP440"
4042
41-
- uses: actions/checkout@v6
42-
4343
- name: Install uv
4444
uses: astral-sh/setup-uv@v4
4545
with:
@@ -50,13 +50,13 @@ jobs:
5050
with:
5151
python-version: "3.11"
5252

53-
- name: Update pyproject.toml with PEP 440 version
53+
- name: Update version.py with PEP 440 version
5454
env:
5555
PEP440_VERSION: ${{ steps.version.outputs.pep440 }}
5656
run: |
57-
# Update version in pyproject.toml if it differs from PEP 440
58-
sed -i "s/^version = .*/version = \"${PEP440_VERSION}\"/" pyproject.toml
59-
echo "Updated pyproject.toml version to ${PEP440_VERSION}"
57+
sed -i "s/^__version__ = .*/__version__ = \"${PEP440_VERSION}\"/" src/google/adk/version.py
58+
echo "Updated version.py to ${PEP440_VERSION}"
59+
grep __version__ src/google/adk/version.py
6060
6161
- name: Build package
6262
run: uv build

0 commit comments

Comments
 (0)