add-to-pypi

add-to-pypi

This action will determine a python package name, version, and git commit from the calling repository, and register a new version of the package in the internal-pypi repo. The package must be configured with a setup.cfg file (as opposed to setup.py). The action calls the internal-pypi/actions/add action, which will only add a new entry if one with a matching version does not already exist. A new version will only be added if the current branch is the repo’s default branch, to protect against accidentally adding a new version if the calling repo’s workflow is not set up correctly.

Templates

name: internal-pypi-upload

on:
  push:
    branches: [main] # The repo's default branch

jobs:
  add-to-pypi:
    name: Add New Version to PyPI
    runs-on: ubuntu-latest
    steps:
      - name: Run add-to-pypi action
        uses: GenapsysInc/internal-actions/reusable-actions/add-to-pypi@main
        with:
          token: ${{ secrets.GH_ACTION }}