diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-19 11:01:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-19 11:01:36 +0000 |
commit | 948a422be120c069e48c63a8770fec7204307897 (patch) | |
tree | 80bc02d5e6cd3527409386aa1d706272bea54e6c /.github/workflows/python-publish.yml | |
parent | Adding upstream version 20.1.0. (diff) | |
download | sqlglot-948a422be120c069e48c63a8770fec7204307897.tar.xz sqlglot-948a422be120c069e48c63a8770fec7204307897.zip |
Adding upstream version 20.3.0.upstream/20.3.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '.github/workflows/python-publish.yml')
-rw-r--r-- | .github/workflows/python-publish.yml | 85 |
1 files changed, 84 insertions, 1 deletions
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 |