From 5c332a5259b403852052420708e55076b3f3e7e7 Mon Sep 17 00:00:00 2001 From: Ragnor Comerford Date: Fri, 12 Apr 2024 17:36:48 +0100 Subject: [PATCH] Add Github Actions for Python Publish --- .github/workflows/python-publish.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..6439225 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,25 @@ +name: Publish Python package + +on: + push: + branches: [ master ] + release: + types: [created] + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.9' + - name: Install Poetry + run: pip install poetry + - name: Build and publish to PyPI + env: + PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + run: | + poetry build + poetry publish --username __token__ --password $PYPI_API_TOKEN