This repository was archived by the owner on Feb 24, 2026. It is now read-only.
Align npm package scope to PixelML #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: release-python | ||
|
Check failure on line 1 in .github/workflows/release-python.yaml
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "py-v*" | ||
| workflow_dispatch: | ||
| inputs: | ||
| version_tag: | ||
| description: "Python tag (py-vX.Y.Z)" | ||
| required: true | ||
| type: string | ||
| permissions: | ||
| contents: write | ||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Validate tag | ||
| id: meta | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then | ||
| TAG="${{ inputs.version_tag }}" | ||
| else | ||
| TAG="${GITHUB_REF_NAME}" | ||
| fi | ||
| if [[ ! "${TAG}" =~ ^py-v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then | ||
| echo "Expected py-vX.Y.Z, got: ${TAG}" >&2 | ||
| exit 1 | ||
| fi | ||
| echo "tag=${TAG}" >> "$GITHUB_OUTPUT" | ||
| echo "version=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT" | ||
| - name: Install build tooling | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install build twine | ||
| - name: Build distributions | ||
| run: | | ||
| python -m build | ||
| - name: Check distributions | ||
| run: | | ||
| twine check dist/* | ||
| - name: Upload release artifacts | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ steps.meta.outputs.tag }} | ||
| name: AgenticFlow CLI Python v${{ steps.meta.outputs.version }} | ||
| generate_release_notes: true | ||
| files: | | ||
| dist/* | ||
| - name: Publish to PyPI | ||
| if: ${{ secrets.PYPI_API_TOKEN != '' }} | ||
| env: | ||
| TWINE_USERNAME: __token__ | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
| run: | | ||
| twine upload dist/* | ||