Skip to content

Use trusted publishing for package uploads #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,39 @@ on:
types: [created]

jobs:
deploy:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
- name: Install build dependencies
run: |
python -m pip install --upgrade pip wheel build
- name: Build package
run: |
python -m build
- name: Publish a Python distribution to PyPI
uses: pypa/[email protected]
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
user: __token__
password: ${{ secrets.PYPI_UPLOAD_API_TOKEN }}

name: docstring-to-markdown dist ${{ github.run_number }}
path: ./dist
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs: [build]
environment:
name: pypi
url: https://pypi.org/p/docstring-to-markdown
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: docstring-to-markdown dist ${{ github.run_number }}
path: ./dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading