[unique_sdk] Publish to PyPI #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "[unique_sdk] Publish to PyPI" | |
on: | |
workflow_dispatch: # If you attempt to push the same version of a package to the Python Package Index (PyPI) multiple times, it will result in an error. PyPI enforces version uniqueness for packages to maintain consistency and prevent confusion among users. | |
env: | |
PACKAGE_DIR: ./unique_sdk | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install Poetry | |
run: | | |
POETRY_VERSION='1.8.3' | |
PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install poetry==$POETRY_VERSION | |
- name: Install dependencies | |
working-directory: ${{ env.PACKAGE_DIR }} | |
run: poetry install | |
- name: Build Package | |
working-directory: ${{ env.PACKAGE_DIR }} | |
run: poetry build | |
- name: Publish to PyPI | |
working-directory: ${{ env.PACKAGE_DIR }} | |
run: poetry publish | |
env: | |
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} |