From 2c23bf6015741ee59278f0e03bdaea6045740821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Tue, 25 Apr 2023 14:21:11 -0600 Subject: Use PyPI Trusted Publishers (#2994) --- .github/workflows/check.yml | 24 +----------------------- .github/workflows/release.yml | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9c11a536..787b01a6 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,6 +1,7 @@ name: check on: push: + tags-ignore: ["**"] pull_request: schedule: - cron: "0 8 * * *" @@ -79,26 +80,3 @@ jobs: run: tox r -e ${{ matrix.tox_env }} env: UPGRADE_ADVISORY: "yes" - - publish: - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - needs: [check, test] - runs-on: ubuntu-22.04 - steps: - - name: Setup python to build package - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - name: Install build - run: python -m pip install build - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Build package - run: pyproject-build -s -w . -o dist - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.8.5 - with: - skip_existing: true - user: __token__ - password: ${{ secrets.pypi_password }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..de4e15c9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Release to PyPI +on: + push: + tags: ["*"] + +jobs: + release: + runs-on: ubuntu-22.04 + permissions: + id-token: write + steps: + - name: Setup python to build package + uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Install build + run: python -m pip install build + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Build package + run: pyproject-build -s -w . -o dist + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@v1.8.5 -- cgit v1.2.1