build(deps): bump pyarrow from 12.0.1 to 14.0.1 #187
This file contains 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: Check PR cloud2sql | |
on: | |
push: | |
tags: | |
- '*.*.*' | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
cloud2sql: | |
name: 'cloud2sql' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
architecture: 'x64' | |
- name: Restore dependency cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{runner.os}}-pip-${{hashFiles('**/requirements*.txt')}} | |
restore-keys: | | |
${{runner.os}}-pip- | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox wheel flake8 build | |
- name: Run tests | |
run: tox | |
- name: Build a binary wheel and a source tarball | |
run: >- | |
python -m build --sdist --wheel --outdir dist/ | |
- name: Publish distribution to PyPI | |
if: github.ref_type == 'tag' | |
continue-on-error: true # Ignore failure to publish to PyPI (e.g., when re-tagging a release) | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_CLOUD2SQL }} | |
packages_dir: ./dist/ | |
- name: Build binary | |
id: pyinstaller | |
run: | | |
python3 -m venv venv | |
source venv/bin/activate | |
pip install -r requirements.txt \ | |
-r requirements-mysql.txt \ | |
-r requirements-postgresql.txt \ | |
-r requirements-parquet.txt \ | |
-r requirements-snowflake.txt | |
pip install pyinstaller | |
pyinstaller --clean --noconfirm --log-level=WARN --distpath=dist --workpath=build cloud2sql.spec | |
if [ "${{ github.ref_type }}" = tag ]; then | |
echo "target=cloud2sql-${{ github.ref_name }}.linux-amd64" >> $GITHUB_OUTPUT | |
else | |
echo "target=cloud2sql-${GITHUB_SHA::7}.linux-amd64" >> $GITHUB_OUTPUT | |
fi | |
- name: Move binary | |
run: | | |
mv dist/cloud2sql dist/${{ steps.pyinstaller.outputs.target }} | |
- name: Upload artifact | |
if: github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.pyinstaller.outputs.target }} | |
path: dist/${{ steps.pyinstaller.outputs.target }} | |
docs: | |
name: Update cloud2sql.com | |
if: github.ref_type == 'tag' | |
needs: | |
- cloud2sql | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get release tag and type | |
id: release | |
shell: bash | |
run: | | |
GITHUB_REF="${{ github.ref }}" | |
tag=${GITHUB_REF##*/} | |
echo "tag=${tag}" >> $GITHUB_OUTPUT | |
if [[ ${{ github.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
echo "prerelease=false" >> $GITHUB_OUTPUT | |
else | |
echo "prerelease=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Check out someengineering/cloud2sql.com | |
if: steps.release.outputs.prerelease == 'false' | |
uses: actions/checkout@v3 | |
with: | |
repository: someengineering/cloud2sql.com | |
path: cloud2sql.com | |
token: ${{ secrets.SOME_CI_PAT }} | |
- name: Install dependencies | |
if: steps.release.outputs.prerelease == 'false' | |
working-directory: ./cloud2sql.com | |
run: | | |
yarn install --frozen-lockfile | |
- name: Update released version | |
if: steps.release.outputs.prerelease == 'false' | |
shell: bash | |
working-directory: ./cloud2sql.com | |
run: | | |
echo $(jq '.version="${{ steps.release.outputs.tag }}" | .link="https://github.com/someengineering/cloud2sql/releases/tag/${{ steps.release.outputs.tag }}"' latestRelease.json) > latestRelease.json | |
yarn format | |
- name: Create someengineering/cloud2sql.com pull request | |
if: steps.release.outputs.prerelease == 'false' | |
uses: peter-evans/create-pull-request@v4 | |
env: | |
HUSKY: 0 | |
with: | |
path: cloud2sql.com | |
commit-message: 'chore: update Cloud2SQL version to ${{ steps.release.outputs.tag }}' | |
title: 'chore: update Cloud2SQL version to ${{ steps.release.outputs.tag }}' | |
body: | | |
Updates Cloud2SQL version on cloud2sql.com to `${{ steps.release.outputs.tag }}`. | |
labels: | | |
🤖 bot | |
branch: ${{ steps.release.outputs.tag }} | |
delete-branch: true | |
token: ${{ secrets.SOME_CI_PAT }} | |
committer: C.K. <[email protected]> | |
author: C.K. <[email protected]> | |
- name: Create release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: ${{steps.release.outputs.prerelease}} |