From 896eaa40a812eeacb6ddf5f69d4a35fac04431a8 Mon Sep 17 00:00:00 2001 From: Antoni Stroinski <55943882+antolo-arch@users.noreply.github.com> Date: Mon, 6 Feb 2023 15:11:54 +0100 Subject: [PATCH 1/2] add PyPI publish pipeline --- .github/workflows/pypipublish.yml | 45 +++++++++++++++++++++++++++++++ .github/workflows/unittest.yml | 3 +-- 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pypipublish.yml diff --git a/.github/workflows/pypipublish.yml b/.github/workflows/pypipublish.yml new file mode 100644 index 00000000..749dfc8a --- /dev/null +++ b/.github/workflows/pypipublish.yml @@ -0,0 +1,45 @@ +name: Publish Python + +on: + release: + types: [published] + +jobs: + tests: + name: run tests + uses: ./.github/workflows/unittest.yml + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to TestPyPI + needs: [tests] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + . + - name: Publish distribution 📦 to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_TEST_KEY }} + repository_url: https://test.pypi.org/legacy/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_LIVE_KEY }} diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 750dfb45..5886303c 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -1,7 +1,6 @@ name: Python package -on: - pull_request: +on: [workflow_call, pull_request] jobs: build: From 34a92eee6d57738f6a586cc6ab0d43f2e507195c Mon Sep 17 00:00:00 2001 From: Antoni Stroinski <55943882+antolo-arch@users.noreply.github.com> Date: Mon, 6 Feb 2023 15:14:41 +0100 Subject: [PATCH 2/2] Update pypipublish.yml --- .github/workflows/pypipublish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypipublish.yml b/.github/workflows/pypipublish.yml index 749dfc8a..0d085e09 100644 --- a/.github/workflows/pypipublish.yml +++ b/.github/workflows/pypipublish.yml @@ -42,4 +42,4 @@ jobs: - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.PYPI_LIVE_KEY }} + password: ${{ secrets.PYPI_KEY }}