Merge pull request #21 from evtn/dev #12
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: Build and Publish on PyPI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- lord | |
paths: | |
- pyproject.toml | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build and publish | |
steps: | |
- name: git-checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install Poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Build and Publish | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
poetry install | |
poetry build | |
poetry config pypi-token.pypi $PYPI_TOKEN | |
poetry publish | |
- run: echo "VERSION=$(poetry version -s)" >> $GITHUB_ENV | |
id: version-check | |
- name: Release on GitHub | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/* | |
tag_name: ${{ env.VERSION }} |