summaryrefslogtreecommitdiffstats
path: root/.github/workflows
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-19 11:01:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-19 11:01:55 +0000
commitf1c2dbe3b17a0d5edffbb65b85b642d0bb2756c5 (patch)
tree5dce0fe2a11381761496eb973c20750f44db56d5 /.github/workflows
parentReleasing debian version 20.1.0-1. (diff)
downloadsqlglot-f1c2dbe3b17a0d5edffbb65b85b642d0bb2756c5.tar.xz
sqlglot-f1c2dbe3b17a0d5edffbb65b85b642d0bb2756c5.zip
Merging upstream version 20.3.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/python-package.yml8
-rw-r--r--.github/workflows/python-publish.yml85
2 files changed, 91 insertions, 2 deletions
diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml
index 0856a38..7f709b2 100644
--- a/.github/workflows/python-package.yml
+++ b/.github/workflows/python-package.yml
@@ -17,9 +17,15 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
+ - name: Create a virtual environment
+ run: |
+ python -m venv .venv
- name: Install dependencies
run: |
+ source ./.venv/bin/activate
python -m pip install --upgrade pip
make install-dev
- name: Run checks (linter, code style, tests)
- run: make check
+ run: |
+ source ./.venv/bin/activate
+ make check
diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml
index de63033..54d79f4 100644
--- a/.github/workflows/python-publish.yml
+++ b/.github/workflows/python-publish.yml
@@ -5,7 +5,85 @@ on:
tags:
- "v*"
+permissions:
+ contents: read
+
+env:
+ python_interpreters: 3.7 3.8 3.9 3.10 3.11
+
jobs:
+ build-rs:
+ strategy:
+ matrix:
+ os: [linux, macos, windows]
+ target: [x86_64, aarch64]
+ include:
+ - os: linux
+ target: i686
+ - os: linux
+ target: armv7
+ - os: linux
+ target: s390x
+ - os: linux
+ target: ppc64le
+ - os: windows
+ target: i686
+ python-architecture: x86
+ runs-on: ${{ (matrix.os == 'linux' && 'ubuntu') || matrix.os }}-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-python@v4
+ with:
+ python-version: '3.10'
+ architecture: ${{ matrix.python-architecture || 'x64' }}
+ - name: Build wheels
+ working-directory: ./sqlglotrs
+ uses: PyO3/maturin-action@v1
+ with:
+ target: ${{ matrix.target }}
+ args: --release --out dist --interpreter $python_interpreters
+ sccache: 'true'
+ manylinux: auto
+ - name: Upload wheels
+ working-directory: ./sqlglotrs
+ uses: actions/upload-artifact@v3
+ with:
+ name: wheels
+ path: dist
+
+ sdist-rs:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Build sdist
+ working-directory: ./sqlglotrs
+ uses: PyO3/maturin-action@v1
+ with:
+ command: sdist
+ args: --out dist
+ - name: Upload sdist
+ working-directory: ./sqlglotrs
+ uses: actions/upload-artifact@v3
+ with:
+ name: wheels
+ path: dist
+
+ deploy-rs:
+ runs-on: ubuntu-latest
+ needs: [build-rs, sdist-rs]
+ steps:
+ - uses: actions/download-artifact@v3
+ with:
+ name: wheels
+ - name: Publish to PyPI
+ working-directory: ./sqlglotrs
+ uses: PyO3/maturin-action@v1
+ env:
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
+ with:
+ command: upload
+ args: --non-interactive --skip-existing *
+
deploy:
runs-on: ubuntu-latest
steps:
@@ -16,6 +94,8 @@ jobs:
python-version: "3.10"
- name: Install dependencies
run: |
+ python -m venv .venv
+ source ./.venv/bin/activate
python -m pip install --upgrade pip
pip install setuptools wheel twine
make install-dev
@@ -24,10 +104,13 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
+ source ./.venv/bin/activate
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Update API docs
- run: make docs
+ run: |
+ source ./.venv/bin/activate
+ make docs
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1