Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jobovy committed Feb 21, 2023
1 parent 060708c commit 194dd8e
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish on PyPI

# Run on release creation
on:
release:
types: [created]

jobs:
build_sdist:
name: Build source directory for release
runs-on: ubuntu-latest
steps:
# check-out this repository
- uses: actions/checkout@v3
# Setup python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Build sdist
run: |
pip install build
python -m build --sdist
- uses: actions/upload-artifact@v3
with:
name: sdist
path: ./dist/*.tar.gz
# Deploy to PyPI
deploy_pypi:
name: Deploy to PyPI
needs: [build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
mkdir tmp_wheelhouse
mkdir wheelhouse
- uses: actions/download-artifact@v3
with:
path: tmp_wheelhouse/
- run: find tmp_wheelhouse/ -mindepth 2 -type f -exec mv -i '{}' wheelhouse/ ';'
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_token }}
packages_dir: wheelhouse/

0 comments on commit 194dd8e

Please sign in to comment.