Skip to content

[executors] feat: add Config to store parameters for query execution #11

[executors] feat: add Config to store parameters for query execution

[executors] feat: add Config to store parameters for query execution #11

name: Publish to PyPI - garf-core
on:
push:
branches:
- main
paths:
- 'libs/core/**'
- '!libs/core/**/*.md'
jobs:
publish:
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Get versions and check for change
id: version_check
run: |
PREV_VERSION=$(git show HEAD~1:libs/core/garf_core/__init__.py | grep -oE "__version__ = '([0-9]+\.[0-9]+\.[0-9]+)'" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
CURRENT_VERSION=$(grep -oE "__version__ = '([0-9]+\.[0-9]+\.[0-9]+)'" libs/core/garf_core/__init__.py | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
if [[ "$CURRENT_VERSION" != "$PREV_VERSION" ]]; then
echo "Version change detected: $PREV_VERSION -> $CURRENT_VERSION"
echo "should_publish=true" >> $GITHUB_OUTPUT
echo "new_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
else
echo "No version change. Skipping publish."
echo "should_publish=false" >> $GITHUB_OUTPUT
fi
- name: Build the package
if: steps.version_check.outputs.should_publish == 'true'
run: uv build libs/core
- name: Publish to PyPI
if: steps.version_check.outputs.should_publish == 'true'
run: uv publish libs/core/dist/*
- name: Create Git Tag
if: steps.version_check.outputs.should_publish == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git tag v${{ steps.version_check.outputs.new_version }}-core
git push origin v${{ steps.version_check.outputs.new_version }}-core