Skip to content

Commit

Permalink
Merge pull request #49 from passaH2O/elbeejay-patch-1
Browse files Browse the repository at this point in the history
Update deploy.yml
  • Loading branch information
elbeejay authored Mar 1, 2025
2 parents 5dff0a1 + 3d257ae commit c708e93
Showing 1 changed file with 43 additions and 21 deletions.
64 changes: 43 additions & 21 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,51 @@ name: deploy

on:
release:
types: [created]

types: [published]
jobs:
deploy:
build:
name: Build distribution
runs-on: ubuntu-latest

# package runs on all os, so just upload from one for any
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- 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/

publish-to-pypi:
name: >-
Publish Python distribution to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pydorado
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- 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 setuptools wheel twine
pip install -r requirements.txt
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- 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

0 comments on commit c708e93

Please sign in to comment.