From 8d101e5a691befba7f0d2942d98c2d0b92e8c14c Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 16 Mar 2023 07:23:30 +0100 Subject: [PATCH 1/7] Fixed Publish to PyPI action --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4260bb1..1b2365b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Fixed - Use a memory database as default database in demo instance - Issues flagged by SonarCloud +- `Publish to PyPI` GitHub action [1.0.0] ### Added From a79d102f140fca7d9504ccb13ce2c5e3885ea7c8 Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 16 Mar 2023 07:25:56 +0100 Subject: [PATCH 2/7] Add the file --- .github/workflows/pypi_publish.yml | 31 +++++++++++------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index c4a1945..dd3a6b7 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -16,25 +16,16 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.8 - - name: Install build tools - run: >- - python -m - pip install - wheel - twine - --user - - - name: Build a binary wheel and a source tarball - run: >- - python - setup.py - sdist - bdist_wheel - - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + - name: Install poetry + uses: abatilo/actions-poetry@v2 with: - user: __token__ - password: ${{ secrets.pypi_password }} + poetry-version: "1.4" + + - name: Build and publish to PYPI + run: | + poetry publish --build + env: + GITHUB: 1 + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} From e6e3316300d0021726d102c5e2fc8637ba05fa5c Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 16 Mar 2023 07:36:47 +0100 Subject: [PATCH 3/7] Test it on PR opening --- .github/workflows/pypi_publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index dd3a6b7..38ea4e1 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -1,9 +1,9 @@ name: Publish to PyPI on: - release: - types: - - created + pull_request: + branches: + - main jobs: build-n-publish: From fe2ba4371c131a5648844c4b5c9151011f43db3e Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 16 Mar 2023 07:39:05 +0100 Subject: [PATCH 4/7] Switch back on on release event --- .github/workflows/pypi_publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 38ea4e1..dd3a6b7 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -1,9 +1,9 @@ name: Publish to PyPI on: - pull_request: - branches: - - main + release: + types: + - created jobs: build-n-publish: From 2039e63976d5be22cc3f55631fd337301c3a559d Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 16 Mar 2023 08:01:13 +0100 Subject: [PATCH 5/7] Update .github/workflows/pypi_publish.yml Co-authored-by: Henrik Stranneheim --- .github/workflows/pypi_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index dd3a6b7..8d6d3e2 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -28,4 +28,4 @@ jobs: poetry publish --build env: GITHUB: 1 - POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} + PYPI_TOKENI: ${{ secrets.PYPI_TOKEN }} From e41a9fafe2f3c962736d69a8ac5f0803d46a395c Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 16 Mar 2023 08:02:24 +0100 Subject: [PATCH 6/7] test on PR --- .github/workflows/pypi_publish.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 8d6d3e2..0f8e9ed 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -1,9 +1,6 @@ name: Publish to PyPI -on: - release: - types: - - created +on: [pull_request] jobs: build-n-publish: From a8553d2cbc67ee201a6715c80ddaa7b0738d25ea Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 16 Mar 2023 08:57:37 +0100 Subject: [PATCH 7/7] switch back --- .github/workflows/pypi_publish.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 0f8e9ed..dd3a6b7 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -1,6 +1,9 @@ name: Publish to PyPI -on: [pull_request] +on: + release: + types: + - created jobs: build-n-publish: @@ -25,4 +28,4 @@ jobs: poetry publish --build env: GITHUB: 1 - PYPI_TOKENI: ${{ secrets.PYPI_TOKEN }} + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}