Skip to content

Commit

Permalink
github/workflows/build-ubuntu-sdist: Publish sdist to pypi on publish
Browse files Browse the repository at this point in the history
  • Loading branch information
illume committed Nov 5, 2023
1 parent 275f503 commit 0e93882
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/build-ubuntu-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ name: Ubuntu sdist
# from running on CI
on:
release:
types: [created]
types: [published]
push:
branches: main
paths-ignore:
Expand Down Expand Up @@ -97,25 +97,25 @@ jobs:
# We upload the generated files under github actions assets
- name: Upload sdist
if: matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.10' # upload sdist only once
if: matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.10' # upload sdist only once
uses: actions/upload-artifact@v3
with:
name: pygame-sdist
path: dist/*.tar.gz

# - name: Upload binaries to Github Releases
# if: github.event_name == 'release' && matrix.os == 'ubuntu-20.04' # upload sdist only once
# if: github.event_name == 'release' && matrix.os == 'ubuntu-22.04' # upload sdist only once
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: dist/*.tar.gz
# tag: ${{ github.ref }}
#
# - name: Upload binaries to PyPI
# if: github.event_name == 'release' && matrix.os == 'ubuntu-20.04' # upload sdist only once
# env:
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: |
# python3 -m pip install twine
# twine upload dist/*.tar.gz
- name: Publish to PyPI
if: github.event.action == 'published' && matrix.os == 'ubuntu-22.04' # upload sdist only once
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python3 -m pip install twine
python3 -m twine upload dist/*.tar.gz

0 comments on commit 0e93882

Please sign in to comment.