Skip to content

Commit

Permalink
Update python-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
crnh authored Mar 21, 2023
1 parent 4c742a7 commit d6ce84b
Showing 1 changed file with 50 additions and 3 deletions.
53 changes: 50 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ permissions:
contents: read

jobs:
deploy:

build:
runs-on: ubuntu-latest
environment: PyPI

permissions:
contents: read

steps:
- uses: actions/checkout@v3
Expand All @@ -33,8 +34,54 @@ jobs:
pip install build
- name: Build package
run: python -m build
- name: Upload dist
uses: actions/[email protected]
with:
name: zospy_dist
path: "dist/"

publish_to_pypi:
name: Publish to PyPI

runs-on: ubuntu-latest
environment: PyPI

steps:
- name: Download dist
uses: actions/[email protected]
with:
name: zospy_dist
path: dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

upload_to_github:
name: Upload to GitHub
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs: build

permissions:
contents: write

steps:
- name: Download dist
uses: actions/[email protected]
with:
name: zospy_dist
path: dist
- name: Upload wheels to GitHub release
uses: svenstaro/[email protected]
with:
tag: ${{ github.ref }}
file: "dist/*.whl"
file_glob: true
- name: Upload dist to GitHub release
uses: svenstaro/[email protected]
with:
tag: ${{ github.ref }}
file: "dist/*.tar.gz"
file_glob: true

0 comments on commit d6ce84b

Please sign in to comment.