From bb97340bca18eac022d4d3c5621e7f57e2da9f06 Mon Sep 17 00:00:00 2001 From: jupfi Date: Sat, 20 Apr 2024 10:53:00 +0200 Subject: [PATCH] Automatic PyPi deployment. --- .github/workflows/python-publish.yml | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 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..94e556b --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,44 @@ +name: Build, Test, and Upload Python Package + +on: + push: + tags: + - "v*.*.*" + + workflow_dispatch: + +permissions: + contents: read + +jobs: + # test: + # uses: ./.github/workflows/ubuntu-python-package.yml # use the callable tests job to run tests + + deploy: + + runs-on: ubuntu-latest + + # needs: [test] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.11" + + - name: Install dependencies + run: | + sudo apt-get update + python -m pip install --upgrade pip + + - name: Publish to PyPI + run: | + python -m venv venv + . ./venv/bin/activate + pip install -U twine build + python -m build . + python -m twine upload --repository pypi --username __token__ --password ${{ secrets.PYPI }} dist/* + env: + PYPI: ${{ secrets.PYPI }}