Skip to content

Fix(snowflake): parse GET_DDL #unknown_policy in ROW ACCESS POLICY [C… #99

Fix(snowflake): parse GET_DDL #unknown_policy in ROW ACCESS POLICY [C…

Fix(snowflake): parse GET_DDL #unknown_policy in ROW ACCESS POLICY [C… #99

Workflow file for this run

name: Publish sqlglot to PyPI
on:
push:
tags:
- "v*"
permissions:
contents: read
jobs:
# Build mypyc wheels for each platform and Python version.
build-wheels:
name: Build wheels (${{ matrix.platform.os }}, ${{ matrix.platform.archs }}, ${{ matrix.python }})
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
python: ["cp39", "cp310", "cp311", "cp312", "cp313", "cp314"]
platform:
- os: ubuntu-latest
archs: x86_64
- os: ubuntu-24.04-arm
archs: aarch64
- os: macos-latest
archs: universal2
- os: windows-latest
archs: AMD64
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: pypa/cibuildwheel@v3.3.1
with:
package-dir: sqlglotc
output-dir: wheelhouse
env:
CIBW_BUILD: ${{ matrix.python }}-*
CIBW_SKIP: "*-musllinux_*"
CIBW_ARCHS: ${{ matrix.platform.archs }}
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.platform.os }}-${{ matrix.platform.archs }}-${{ matrix.python }}
path: ./wheelhouse/*.whl
# Build the sqlglotc sdist (source-only, no wheels — always compiles on install).
sdist-c:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install build tools
run: pip install build
- name: Build sdist
run: |
cd sqlglotc
python -m build --sdist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sqlglotc-sdist
path: sqlglotc/dist/*.tar.gz
# Publish sqlglotc wheels and sdist to PyPI.
publish-sqlglotc:
needs: [build-wheels, sdist-c]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist/
merge-multiple: true
- uses: actions/download-artifact@v4
with:
name: sqlglotc-sdist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
# Publish the main sqlglot package.
deploy:
needs: publish-sqlglotc
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m venv .venv
source ./.venv/bin/activate
python -m pip install --upgrade pip
pip install build twine
make install-dev
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
source ./.venv/bin/activate
python -m build
twine upload dist/*
- name: Update CHANGELOG
id: changelog
continue-on-error: true
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
- name: Commit CHANGELOG.md
continue-on-error: true
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: "Update CHANGELOG.md for ${{ github.ref_name }} [skip ci]"
file_pattern: "CHANGELOG.md"
- name: Update API docs
run: |
source ./.venv/bin/activate
make docs
echo "sqlglot.com" > docs/CNAME
mv docs /tmp/generated-docs
git checkout -B api-docs origin/main
rm -rf docs
mv /tmp/generated-docs docs
- name: Commit API docs
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: api-docs
commit_message: 'Update API docs for ${{ github.ref_name }} [skip ci]'
file_pattern: 'docs'
push_options: '--force'