name: Publish to Test PyPI on: workflow_dispatch jobs: build-n-publish: name: Build and publish to Test PyPI runs-on: ubuntu-latest permissions: # IMPORTANT: this permission is mandatory for trusted publishing id-token: write steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Set up Python 3.10 uses: actions/setup-python@v6 with: python-version: "3.10" - name: Install dependencies run: pip install tox wheel - name: Build man page if not present run: | if [ ! -f doc/build/man/bandit.1 ]; then tox run -e manpage fi - name: Build a binary wheel and a source tarball run: | python setup.py sdist bdist_wheel - name: Publish distribution to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/