name: release-please
on:
push:
branches: [main]
permissions:
contents: read
jobs:
release-please:
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
tag_name: ${{ steps.release-please.outputs.tag_name }}
permissions:
contents: write
pull-requests: write
issues: write
steps:
- uses: google-github-actions/release-please-action@db8f2c60ee802b3748b512940dde88eabd7b7e01 # v3.7.13
id: release-please
with:
release-type: python
package-name: falcon-mcp
pull-request-header: ':rocket: New Release Incoming! :rocket:'
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"refactor","section":"Refactoring","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":true}]'
- name: Checkout PR branch
if: ${{ steps.release-please.outputs.pr }}
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
ref: ${{ fromJSON(steps.release-please.outputs.pr).headBranchName }}
- name: Sync gemini-extension.json version
if: ${{ steps.release-please.outputs.pr }}
run: |
# Extract version from pyproject.toml (already updated by release-please)
VERSION=$(grep -Po '(?<=^version = ")[^"]*' pyproject.toml)
CURRENT=$(jq -r '.version' gemini-extension.json)
if [ "$VERSION" != "$CURRENT" ]; then
jq --arg v "$VERSION" '.version = $v' gemini-extension.json > tmp.json && mv tmp.json gemini-extension.json
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add gemini-extension.json
git commit -m "chore: sync gemini-extension.json version to $VERSION"
git push
fi
- name: Update uv.lock
if: ${{ steps.release-please.outputs.pr }}
run: |
pip install uv==0.9.21
uv lock
if git diff --quiet uv.lock; then
echo "uv.lock is already up to date"
else
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add uv.lock
git commit -m "chore: update uv.lock"
git push
fi
pypi-publish:
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 15
environment: release
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
ref: ${{ needs.release-please.outputs.tag_name }}
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: '3.11'
- name: Build package
run: |
pip install uv==0.9.21
uv pip install --system build==1.3.0
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
docker-release:
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
permissions:
contents: read
packages: write
uses: ./.github/workflows/docker-build-push.yml
with:
tag_name: ${{ needs.release-please.outputs.tag_name }}
secrets: inherit