Skip to content

[Release] v0.1.7 (#41) #2

[Release] v0.1.7 (#41)

[Release] v0.1.7 (#41) #2

Workflow file for this run

# PyPI 배포: Repository Settings → Secrets and variables → Actions 에서 PYPI_TOKEN (PyPI API token) 등록 필요.
name: Release Python packages
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
jobs:
publish-planforge-core:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install build tools
run: pip install build twine
- name: Verify tag version matches planforge-core version
if: github.event_name == 'push'
working-directory: packages/core
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
CORE_VERSION=$(grep -E '^version\s*=' pyproject.toml | sed 's/.*=\s*"\(.*\)".*/\1/')
echo "Tag version: ${TAG_VERSION}"
echo "planforge-core version: ${CORE_VERSION}"
if [[ "${TAG_VERSION}" != "${CORE_VERSION}" ]]; then
echo "Tag version and planforge-core version must match."
exit 1
fi
- name: Build planforge-core
working-directory: packages/core
run: python -m build
- name: Publish planforge-core to PyPI
working-directory: packages/core
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*
publish-planforge-cli:
runs-on: ubuntu-latest
needs: publish-planforge-core
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install build tools
run: pip install build twine
- name: Verify tag version matches planforge (CLI) version
if: github.event_name == 'push'
working-directory: packages/cli-py
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
CLI_VERSION=$(grep -E '^version\s*=' pyproject.toml | sed 's/.*=\s*"\(.*\)".*/\1/')
echo "Tag version: ${TAG_VERSION}"
echo "planforge (CLI) version: ${CLI_VERSION}"
if [[ "${TAG_VERSION}" != "${CLI_VERSION}" ]]; then
echo "Tag version and planforge CLI version must match."
exit 1
fi
- name: Build planforge CLI
working-directory: packages/cli-py
run: python -m build
- name: Publish planforge CLI to PyPI
working-directory: packages/cli-py
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*