Skip to content

Commit

Permalink
Update deploy_pypi.yml to use the latest version of Actions. Refer …
Browse files Browse the repository at this point in the history
  • Loading branch information
akikuno committed May 18, 2024
1 parent 26e3b6b commit 1a54b40
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/deploy_pypi.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: deploy to pypi
name: Upload Python Package to PyPI

on:
release:
types: [created]
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build
run: |
python3 setup.py sdist --formats=zip
- name: Publish a Python distribution to PyPI
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

# Reference:
# https://docs.github.com/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

0 comments on commit 1a54b40

Please sign in to comment.