Workflow file for this run
This file contains 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: Test and Publish to PyPI | |
on: | |
release: | |
types: [published] | |
jobs: | |
test-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Set version from release tag | |
run: | | |
TAG_NAME=${{ github.event.release.tag_name }} | |
echo "Release tag: $TAG_NAME" | |
poetry version ${TAG_NAME#v} # 'v' 접두사를 제거하고 버전 설정 | |
cat pyproject.toml # 확인용 | |
- name: Install dependencies | |
run: | | |
poetry install --with dev | |
- name: Run tests | |
run: | | |
poetry run pytest | |
- name: Publish to PyPI | |
if: success() | |
env: | |
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
poetry publish --build |