Skip to content

Commit

Permalink
update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
suzhoum committed Nov 1, 2024
1 parent 2ec5163 commit 2d27573
Showing 1 changed file with 19 additions and 34 deletions.
53 changes: 19 additions & 34 deletions .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,31 @@

name: Pypi Release

on:
on:
release:
types: [created]

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install Dependency
run: python -m pip install -U build
- name: Build Distribution Pakcage
run: python -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
deploy:

publish-to-pypi:
name: Publish to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
username: __token__
password: ${{ secrets.PYPI_TOKEN }}
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets. PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets. PYPI_PASSWORD }}
RELEASE: 1

run: |
python -m build
twine upload dist/* --verbose

0 comments on commit 2d27573

Please sign in to comment.