Skip to content

Merge pull request #72 from Lakshmi-bashyam/package-upgrade #9

Merge pull request #72 from Lakshmi-bashyam/package-upgrade

Merge pull request #72 from Lakshmi-bashyam/package-upgrade #9

Workflow file for this run

name: Publish Release
on:
push:
tags:
- "*"
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: 'poetry'
- name: Install dependencies
run: poetry install --no-root
- name: Test Code
run: poetry run pytest
publish-pypi:
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Build and upload to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: |
if [ $(poetry version -s) != ${{ github.ref_name }} ]; then
echo "The version specified in pyproject.toml and the tag name are not the same"
echo "Will use the tag name as version name"
poetry version ${{ github.ref_name }}
fi
poetry publish --build