k-skill/.github/workflows/release-python.yml
Jeffrey (Dongkyu) Kim 3f9aee6111 Make Python release workflow plan safely
Move Python package detection into an explicit setup job so GitHub Actions can plan the release workflow instead of failing before jobs/logs are created.

Constraint: Python release flow is scaffold-only until a real python-packages/* pyproject exists
Rejected: Keeping job-level hashFiles guards | GitHub reported zero-second workflow-file failures with no jobs or logs
Confidence: high
Scope-risk: narrow
Directive: Keep release-please publish work gated behind detected concrete Python package paths
Tested: ruby YAML parse; npm run ci
Not-tested: actual release-please publication because no Python package exists yet
2026-05-14 12:26:57 +09:00

58 lines
1.7 KiB
YAML

name: Release Python packages
on:
push:
branches:
- main
paths:
- ".github/release-please/**"
- ".github/workflows/release-python.yml"
- "python-packages/**"
workflow_dispatch:
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
detect_python_packages:
runs-on: ubuntu-latest
outputs:
has_python_packages: ${{ steps.detect.outputs.has_python_packages }}
steps:
- uses: actions/checkout@v4
- id: detect
shell: bash
run: |
if find python-packages -mindepth 2 -maxdepth 2 -name pyproject.toml -print -quit | grep -q .; then
echo "has_python_packages=true" >> "$GITHUB_OUTPUT"
else
echo "has_python_packages=false" >> "$GITHUB_OUTPUT"
fi
scaffold-only:
needs: detect_python_packages
if: ${{ needs.detect_python_packages.outputs.has_python_packages != 'true' }}
runs-on: ubuntu-latest
steps:
- run: echo "No Python package exists yet. release-please remains scaffold-only."
release:
needs: detect_python_packages
if: ${{ needs.detect_python_packages.outputs.has_python_packages == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: release
uses: googleapis/release-please-action@v4
with:
config-file: .github/release-please/python-config.json
manifest-file: .github/release-please/python-manifest.json
- name: Reminder
if: ${{ steps.release.outputs.releases_created == 'true' }}
run: |
echo "Python package release metadata was created."
echo "Wire package-specific build/publish steps here when the first python package is added."