From bd757eb51d129790fe4b1ad8523f6a8e6a4483f7 Mon Sep 17 00:00:00 2001 From: fbjorn Date: Tue, 6 Feb 2024 17:49:37 +0300 Subject: [PATCH] Try new way of publishing --- .github/workflows/publish.yaml | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 3152193..7181144 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -2,6 +2,8 @@ name: Build and publish to PyPI on: push: + branches: + - "ci/use-trusted-publisher" tags: - "*" @@ -9,6 +11,10 @@ jobs: build_and_publish: name: Build and publish runs-on: ubuntu-latest + environment: testpypi + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write steps: - name: Checkout 🔁 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 @@ -24,16 +30,23 @@ jobs: - name: Install dependencies 🛠 run: poetry install - - name: Run pre-commit 🤔 - run: pre-commit run --all-files + # - name: Run pre-commit 🤔 + # run: pre-commit run --all-files + # + # - name: Run tests 🌈 + # run: poetry run invoke test - - name: Run tests 🌈 + - name: Build the package 📦 run: poetry run invoke test - name: Publish package to PyPI 🙌 - run: | - set -e - poetry config http-basic.pypi "__token__" "${PYPI_TOKEN}" - poetry publish --build - env: - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ +# - name: Publish package to PyPI 🙌 +# run: | +# set -e +# poetry config http-basic.pypi "__token__" "${PYPI_TOKEN}" +# poetry publish --build +# env: +# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}