Skip to content

Commit

Permalink
update pypi workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhahn committed Jan 20, 2023
1 parent b5ef8e1 commit e7a1486
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions .github/workflows/upload_pypi.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,23 @@
name: upload pypi
name: Publish on pypi.org

on:
# trigger only on release
release:
types: [published]
# to trigger workflow manually from actions-tab
workflow_dispatch:
release:
types: [published]

jobs:
publish:
name: Upload to PyPI
if: |
startsWith(github.ref, 'refs/tags/v') &&
startsWith(github.repository, 'TUW-GEO')
needs: build
runs-on: ubuntu-latest
steps:
- name: Print environment variables
run: |
echo "GITHUB_REF = $GITHUB_REF"
echo "GITHUB_REPOSITORY = $GITHUB_REPOSITORY"
- name: Download Artifacts
uses: actions/download-artifact@v2
- name: Display downloaded files
run: ls -aR
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: python3 -m pip install --upgrade build && python3 -m build
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@v1.4.1
with:
skip_existing: true
verbose: true
verify_metadata: true
packages_dir: Artifacts/dist/
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }} # this
password: ${{ secrets.PYPI_API_TOKEN }} # this needs to be uploaded to github actions secrets

0 comments on commit e7a1486

Please sign in to comment.