Skip to content

Vtk prompt fixes

Vtk prompt fixes #108

Workflow file for this run

name: Build and Publish
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine setuptools-scm
- name: Build package
run: python -m build
- name: Check package
run: twine check dist/*
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
publish-testpypi:
name: Publish to TestPyPI
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
environment:
name: testpypi
url: https://test.pypi.org/p/vtk-prompt
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine setuptools-scm
- name: Build package with unique version
run: |
# Create a unique dev version for TestPyPI
SETUPTOOLS_SCM_PRETEND_VERSION="0.1.dev$(date +%Y%m%d%H%M%S)"
export SETUPTOOLS_SCM_PRETEND_VERSION
python -m build
- name: Check package
run: twine check dist/*
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
verbose: true
- name: Print TestPyPI installation instructions
run: |
echo "Package published to TestPyPI!"
echo "To install from TestPyPI (with dependencies from PyPI):"
echo "pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ vtk-prompt"
publish-pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'release' && github.event.action == 'published'
environment:
name: pypi
url: https://pypi.org/p/vtk-prompt
permissions:
id-token: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1