first commit
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# This workflow will upload a Python Package using
|
||||
# Poetry when a release is published
|
||||
|
||||
name: Publish Python Package (PyPi)
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Set up Poetry
|
||||
uses: Gr1N/setup-poetry@v7
|
||||
- name: Bump Poetry version
|
||||
run: |
|
||||
tag=${{ github.event.release.tag_name }}
|
||||
version_number=${tag#?}
|
||||
poetry version $version_number
|
||||
- name: Commit changes
|
||||
uses: EndBug/add-and-commit@v4
|
||||
with:
|
||||
message: "Bump version to ${{ github.event.release.tag_name }}"
|
||||
add: "pyproject.toml"
|
||||
ref: "master"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and publish to PyPi
|
||||
env:
|
||||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
|
||||
run: |
|
||||
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
|
||||
poetry build
|
||||
poetry publish
|
||||
Reference in New Issue
Block a user