[executors] fix: make import of sql and bq executors optional #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to PyPI - garf-executors | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'libs/executors/**' | |
| - '!libs/executors/**/*.md' | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| 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/executors/garf_executors/__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/executors/garf_executors/__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/executors | |
| - name: Publish to PyPI | |
| if: steps.version_check.outputs.should_publish == 'true' | |
| run: uv publish libs/executors/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 }}-executors | |
| git push origin v${{ steps.version_check.outputs.new_version }}-executors |