Skip to content

Commit

Permalink
chore: Refactor publish workflow for PyPI deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Latand committed May 15, 2024
1 parent a7e869f commit 35eca61
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
name: "Deploy"
name: Deploy

on:
push:
branches:
- main

jobs:
pypi-publish:
name: Upload release to PyPI
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/<your-pypi-project-name>

permissions:
id-token: write
contents: read
id-token: write

steps:
- name: Download artifacts
uses: actions/download-artifact@v1
with:
name: dist
path: dist
- name: Check out the repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build the package
run: |
python setup.py sdist bdist_wheel
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

0 comments on commit 35eca61

Please sign in to comment.