Skip to content

Commit

Permalink
Try to fix deployement
Browse files Browse the repository at this point in the history
  • Loading branch information
xgarrido authored Mar 26, 2024
1 parent 2b24fc8 commit 07b41c3
Showing 1 changed file with 32 additions and 12 deletions.
44 changes: 32 additions & 12 deletions .github/workflows/deploying.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: Upload Python Package

on:
release:
types: [created]
- push
- pull_request

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
Expand All @@ -15,15 +19,31 @@ jobs:
with:
python-version: '3.x'

- name: Install dependencies
- name: Build sdist and wheel
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python -m pip install build
python -m build
- 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/*
- uses: actions/upload-artifact@v4
with:
path: dist/*
retention-days: 1

upload_pypi:
if: github.event_name == 'release' && github.event.action == 'published'
needs: [deploy]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
# To test: repository_url: https://test.pypi.org/legacy/

0 comments on commit 07b41c3

Please sign in to comment.