Skip to content

Bump ruff from 0.3.4 to 0.4.2 (#143) #60

Bump ruff from 0.3.4 to 0.4.2 (#143)

Bump ruff from 0.3.4 to 0.4.2 (#143) #60

Workflow file for this run

# Creates a git tag and publishes to pypi based on the
# version specified in pyproject.toml.
name: Publish to PyPI
on:
push:
branches:
- main
paths:
- pyproject.toml
workflow_dispatch:
permissions:
contents: write
jobs:
test:
uses: ./.github/workflows/test.yml
publish:
needs: test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
cache: "poetry"
python-version: "3.11"
- name: Install dependencies
run: poetry install --only main
- name: get cvml package version
run: echo "VERSION=$(poetry version --short)" >> $GITHUB_ENV
- name: check if git tag exists
run: |
git fetch --tags
if [[ $(git tag -l $VERSION | wc -l) -eq '1' ]]; then
echo "git tag already exists"
echo "PUBLISH=false" >> $GITHUB_ENV
else
echo "git tag does not exist"
echo "PUBLISH=true" >> $GITHUB_ENV
fi
- name: create git tag
if: env.PUBLISH == 'true'
run: git tag $VERSION
- name: push git tag
if: env.PUBLISH == 'true'
run: git push --tags
- name: build and publish to pypi
if: env.PUBLISH == 'true'
run: poetry publish --build --username $PYPI_USERNAME --password $PYPI_TOKEN
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}