Skip to content

Merge pull request #54 from Lakshmi-bashyam/rdflib-version #5

Merge pull request #54 from Lakshmi-bashyam/rdflib-version

Merge pull request #54 from Lakshmi-bashyam/rdflib-version #5

Workflow file for this run

name: Publish Release
on:
push:
tags:
- "*"
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
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@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- 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