Skip to content

test on TestPyPi

test on TestPyPi #22

Workflow file for this run

name: Publish to PyPI
on:
push:
branches:
- publish-testing
jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment: pypi-package
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12.2
uses: actions/setup-python@v3
with:
python-version: "3.12.2"
- name: Setup dependencies
run: |
python -m pip install --upgrade pip
pip install poetry==2.1.1
poetry install
- name: Build package
run: |
poetry build
# Install invariant package in a virtual environment for testing
#- name: Create virtual environment and install package
# run: |
# python -m venv venv
# source venv/bin/activate
# pip install dist/*.whl
# Make sure the tests pass when the package is built and installed
#- name: Run tests
# env:
# OPENAI_API_KEY: ${{ secrets.INVARIANT_TESTING_OPENAI_KEY }}
# run: |
# source venv/bin/activate
# python -m pytest invariant/tests/
- name: Set TestPyPI credentials
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config pypi-token.testpypi ${{ secrets.TESTPYPI_API_TOKEN }}
# Publish to TestPyPI
- name: Publish to TestPyPI
run: |
poetry publish -r testpypi --dist-dir dist