Skip to content

Commit

Permalink
Update release.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbuntemeyer authored Feb 14, 2024
1 parent 7d64291 commit 62c2e1b
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
name: "Publish Python 🐍 distributions 📦 to PyPI"

---
name: Release

on: [push]
on:
release:
types:
- published

jobs:
release:
build-n-publish-pypi:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install -U pip wheel setuptools setuptools-scm twine
- name: Build distributions
python -m pip install --upgrade pip
python -m pip install setuptools setuptools-scm wheel twine check-manifest
- name: Build a binary wheel and a source tarball
run: python setup.py sdist bdist_wheel

- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 62c2e1b

Please sign in to comment.