From e93837f2ea6322c986661ffd4ade22cf9bc437e6 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 17 Mar 2024 15:42:30 +0100 Subject: [PATCH] Add PyPi pipeline (#482) * add pypi pipeline * build and publish * prepare inputs * matrix strategy * matrix * install only whl * try upload should error * try token * retry token * use token directly * no poetry config * try again * upload on release * bump --- .github/workflows/pypi.yaml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/pypi.yaml diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml new file mode 100644 index 0000000..15b8c57 --- /dev/null +++ b/.github/workflows/pypi.yaml @@ -0,0 +1,35 @@ +name: Pip package + +on: + push: + release: + types: [published] + +jobs: + build-and-push: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10"] + poetry-version: ["1.7.1"] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: ./.github/actions/prepare + with: + python-version: ${{ matrix.python-version }} + poetry-version: ${{ matrix.poetry-version }} + + - name: Build package + run: | + poetry build + + - name: Install package + run: | + pip install --upgrade dist/*.whl + + - name: Upload to PyPI on release + if: github.event_name == 'release' + run: | + poetry publish -u __token__ -p ${{ secrets.PYPI_API_TOKEN }}