fix: publication to PyPiTest #59
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: Python Package | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
release: | |
types: [published] | |
jobs: | |
build-publish: | |
name: Build and publish package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install uv | |
python -m uv pip install build | |
- name: Build the CLI | |
run: python -m build --sdist --wheel | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a | |
with: | |
name: armonik_cli | |
path: dist/* | |
if-no-files-found: error | |
- name: Publish to PyPiTest | |
if: github.event_name != 'release' # Skip for actual releases | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.DEV_PYPI_CLI_TOKEN }} | |
print-hash: true | |
packages-dir: dist/ | |
repository-url: https://test.pypi.org/legacy/ | |
- name: Publish to PyPiTest | |
if: github.event_name == 'release' # Publish on releases | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_CLI_TOKEN }} | |
print-hash: true | |
packages-dir: dist/ |