Skip to content

Update python-publish.yml -- find dist point all files #42

Update python-publish.yml -- find dist point all files

Update python-publish.yml -- find dist point all files #42

name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
on: push
jobs:
publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
#if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/nnetsauce # Replace <package-name> with your PyPI project name
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Find directory two levels higher
id: find-dir
run: |
found_dir=$(find ../.. -type d -name "dist" -print -quit)
echo "Found directory two levels higher: $found_dir"
echo "PACKAGES_DIR=$found_dir" >> $GITHUB_ENV
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ${{ env.PACKAGES_DIR }}/*
password: ${{ secrets.PYPI_GLOBAL }}
repository-url: https://test.pypi.org/legacy/