Skip to content

Commit

Permalink
use trusted publishing for pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
zsol committed May 26, 2024
1 parent 96f5341 commit 6379a35
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
release:
types: [published]
push:
branches: [main]
branches: [main, pypi-trusted-publishing]

permissions:
contents: read
Expand Down Expand Up @@ -37,6 +37,7 @@ jobs:
- name: Build a source tarball
env:
LIBCST_NO_LOCAL_SCHEME: 1
SETUPTOOLS_SCM_PRETEND_VERSION: 0.0.1
run: >-
hatch run python -m
build
Expand All @@ -46,14 +47,10 @@ jobs:
if: github.event_name == 'push'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
packages-dir: ${{ steps.download.outputs.download-path }}
- name: Publish distribution 📦 to PyPI
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: ${{ steps.download.outputs.download-path }}

0 comments on commit 6379a35

Please sign in to comment.