Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Update release to PyPI workflow
  • Loading branch information
willbarton committed Jan 12, 2023
commit 17e7d9c20e1bb175266a853976e3fd02a03227a0
16 changes: 9 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
name: Publish to PyPI
on:
on:
release:
types: [published]
workflow_dispatch:


jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v3 is out. Can this use actions/checkout@v3? https://github.com/actions/checkout/releases/tag/v3.3.0

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pip build
pip install twine wheel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pip install twine wheel
pip install twine

Is wheel needed here? From using python -m build (very cool, by the way, TIL this is a thing), it looks like the build package handles that install itself in an isolated environment.

- name: Build the package
run: |
python setup.py sdist bdist_wheel --universal
python -m build
- name: Upload to PyPI
run: twine upload dist/*
env:
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}