Skip to content

Commit

Permalink
#53 Adjust workflow to separate build and publishing of artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
magoorden committed Jun 18, 2024
1 parent daeaa17 commit 4866135
Showing 1 changed file with 41 additions and 20 deletions.
61 changes: 41 additions & 20 deletions .github/workflows/to_pypi.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,51 @@
name: Upload to PyPI
name: Publish to PyPI
on:
release:
types: created

jobs:
upload-to-pypi:
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Install pypa/build
run: >-
python -m pip install build --user
publish-to-pypi:
name: >-
Publish distribution to PyPI
needs:
- build
runs-on: ubuntu-latest

- name: Build a binary wheel and a source tarball
run: >-
python -m build --sdist --wheel --outdir dist/
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
skip_existing: true

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
skip_existing: true

0 comments on commit 4866135

Please sign in to comment.