From ea92755881b37a098564db4df7ca40ca6c033e71 Mon Sep 17 00:00:00 2001 From: Tobias Olsen Date: Fri, 25 Mar 2022 17:09:34 +0000 Subject: [PATCH] Added automatic update of pip package --- .github/workflows/publish-to-pypi.yml | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..cdcc2c4 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,44 @@ +name: Publish Python 🐍 distributions 📦 to PyPI + + +# Run on every commit tag which begins with "v" (e.g., "v0.1.4") +on: + push: + tags: + - "v*" + + +jobs: + build-and-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v2 + + # Setup Python (faster than using Python container) + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + + - name: Install pipenv + run: | + python -m pip install --upgrade pipenv wheel + - id: cache-pipenv + uses: actions/cache@v1 + with: + path: ~/.local/share/virtualenvs + key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} + + - name: Install dependencies + if: steps.cache-pipenv.outputs.cache-hit != 'true' + run: | + pipenv install --deploy --dev + - name: Build a binary wheel and a source tarball + run: | + pipenv run build + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }}