From d16e2fd70bf7863fb0a081e6ecfe831cd3512d2d Mon Sep 17 00:00:00 2001 From: curquiza Date: Tue, 16 Jan 2024 18:18:46 +0100 Subject: [PATCH 1/3] Update CI to publish to pypi --- .github/workflows/pypi-publish.yml | 35 ++++++++++++------------------ 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index e4acfce2..2fedeaaa 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -9,24 +9,17 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.8' - cache: "pipenv" - - name: Check release validity - run: sh .github/scripts/check-release.sh - - name: Install pipenv - run: pipx install pipenv - - name: Install dependencies - run: | - pipenv install - pipenv run pip3 install build setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - pipenv run python3 -m build - pipenv run twine upload dist/* + - uses: actions/checkout@v4 + - name: Install Poetry + run: pipx install poetry + - name: Add PyPi token to Poetry + run: poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + cache: "poetry" + - name: Install Dependencies + run: poetry install + - name: Publish package + run: poetry publish --build From 5fa112e13594accd944928087ebb9a3e374c9079 Mon Sep 17 00:00:00 2001 From: curquiza Date: Tue, 16 Jan 2024 18:27:06 +0100 Subject: [PATCH 2/3] Fix indentation --- .github/workflows/pypi-publish.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 2fedeaaa..e6f9e897 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -9,17 +9,17 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Install Poetry - run: pipx install poetry - - name: Add PyPi token to Poetry - run: poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.11 - cache: "poetry" - - name: Install Dependencies - run: poetry install - - name: Publish package - run: poetry publish --build + - uses: actions/checkout@v4 + - name: Install Poetry + run: pipx install poetry + - name: Add PyPi token to Poetry + run: poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + cache: "poetry" + - name: Install Dependencies + run: poetry install + - name: Publish package + run: poetry publish --build From 3abccb2156aabca247223ddbc4d4a91c77e83e7d Mon Sep 17 00:00:00 2001 From: curquiza Date: Tue, 16 Jan 2024 18:57:45 +0100 Subject: [PATCH 3/3] Go back to previous publish --- .github/workflows/pypi-publish.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index e6f9e897..f9af835d 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -10,16 +10,23 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Poetry - run: pipx install poetry - - name: Add PyPi token to Poetry - run: poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.11 - cache: "poetry" - - name: Install Dependencies - run: poetry install - - name: Publish package - run: poetry publish --build + python-version: '3.8' + cache: "pipenv" + - name: Check release validity + run: sh .github/scripts/check-release.sh + - name: Install pipenv + run: pipx install pipenv + - name: Install dependencies + run: | + pipenv install + pipenv run pip3 install build setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: "pypi-${{ secrets.PYPI_API_TOKEN }}" + run: | + pipenv run python3 -m build + pipenv run twine upload dist/*