Skip to content

Latest commit

 

History

History
71 lines (60 loc) · 2.91 KB

package-testpypi.md

File metadata and controls

71 lines (60 loc) · 2.91 KB

package-testpypi.yml

This workflow will build the package using the hynek/build-and-inspect-python-package action, upload the package to TestPyPI, and then verify that the package can be installed from TestPyPI.

In order to ensure each version uploaded to TestPyPI is unique, the workflow will first create a unique .postN version number for the package on top of the officially released version of the package, incrementing N each time the workflow runs.

Important

When calling this reusable workflow, the permissions must be set as follows:

permissions:
  contents: read
  id-token: write
  attestations: write

Note

This workflow uses concurrency to limit the number of builds that can run at the same time to a single build. This concurrency is shared across the 'pypi (Reusable Workflows)' concurrency group within the repo that calls this workflow.

Tip

See the Workflow file for implementation details.

Inputs

Input variable Necessity Description Default
package-name required The name of the package to build, upload, and install.
repo-name required The full name of the repository to use to gate uploads, in the format owner/repo.

Example

name: Publish to TestPyPI
on:
  push:
    branches: [main]
concurrency:  # This concurrency is not required, but can be added if extra control of concurrent builds is required
  group: pypi
jobs:
  package-testpypi:
    uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-package-testpypi.yml@v0.0.1
    with:
      package-name: my-package  # required
      repo-name: owner/my-package  # required
    permissions:
      contents: read
      id-token: write
      attestations: write