qbit_manage/.github/workflows/pypi-publish.yml
dependabot[bot] 078bbbfbb8 Bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 10:25:46 -05:00

68 lines
2 KiB
YAML

name: PyPI Publish
on:
push:
tags:
- v*
workflow_dispatch:
inputs:
test_pypi:
description: 'Publish to Test PyPI instead of PyPI'
required: false
default: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pypi-publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Required for trusted publishing to PyPI
steps:
- name: Check Out Repo
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build twine
- name: Build package
run: python -m build
- name: Verify package
run: |
python -m twine check dist/*
ls -la dist/
- name: Publish to Test PyPI
if: ${{ github.event.inputs.test_pypi == 'true' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
# Option 1: Use trusted publishing (recommended)
# Repository must be configured in Test PyPI with GitHub as trusted publisher
# Option 2: Use API token (uncomment the line below and comment out the trusted publishing)
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
verbose: true
skip-existing: true
- name: Publish to PyPI
if: ${{ github.event.inputs.test_pypi != 'true' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
# Option 1: Use trusted publishing (recommended)
# Repository must be configured in PyPI with GitHub as trusted publisher
# Option 2: Use API token (uncomment the line below and comment out the trusted publishing)
# password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
skip-existing: true