diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 11:14:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 11:14:33 +0000 |
commit | 52ab79c1cbb3acd7dbf119eeeb2a3cc065fe59b7 (patch) | |
tree | f24fa38a434024fd33a936506a0664886cb497b1 /.github | |
parent | Releasing debian version 23.13.1-1. (diff) | |
download | sqlglot-52ab79c1cbb3acd7dbf119eeeb2a3cc065fe59b7.tar.xz sqlglot-52ab79c1cbb3acd7dbf119eeeb2a3cc065fe59b7.zip |
Merging upstream version 23.13.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/python-publish.yml | 18 | ||||
-rw-r--r-- | .github/workflows/should_deploy_sqlglotrs.sh | 11 |
2 files changed, 28 insertions, 1 deletions
diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index fdba150..1b55437 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -9,7 +9,20 @@ permissions: contents: read jobs: + should-deploy-rs: + runs-on: ubuntu-latest + outputs: + deploy: ${{ steps.set_deploy.outputs.deploy }} + steps: + - uses: actions/checkout@v3 + - id: check_deploy + run: | + bash ./.github/workflows/should_deploy_sqlglotrs.sh + if [ $? -eq 0 ]; then echo "deploy=true" >> $GITHUB_OUTPUT; fi + build-rs: + needs: should-deploy-rs + if: needs.should-deploy-rs.outputs.deploy == 'true' strategy: matrix: os: [linux, macos, windows] @@ -51,6 +64,8 @@ jobs: path: sqlglotrs/dist sdist-rs: + needs: should-deploy-rs + if: needs.should-deploy-rs.outputs.deploy == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -67,8 +82,9 @@ jobs: path: sqlglotrs/dist deploy-rs: + needs: [should-deploy-rs, build-rs, sdist-rs] + if: needs.should-deploy-rs.outputs.deploy == 'true' runs-on: ubuntu-latest - needs: [build-rs, sdist-rs] steps: - uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/should_deploy_sqlglotrs.sh b/.github/workflows/should_deploy_sqlglotrs.sh new file mode 100644 index 0000000..b62589b --- /dev/null +++ b/.github/workflows/should_deploy_sqlglotrs.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -ex + +CARGO_TOML_PATH="./sqlglotrs/Cargo.toml" +CARGO_TOML_MOST_RECENT_COMMIT=$(git log -1 --pretty="%H" -- $CARGO_TOML_PATH | head -1) + +PREVIOUS_TAG=$(git tag --sort=-creatordate | head -n 2 | tail -n 1) +PREVIOUS_TAG_COMMIT=$(git rev-list -n 1 $PREVIOUS_TAG) + +# We should only deploy sqlglotrs if Cargo.toml was modified between this tag and the previous one +git merge-base --is-ancestor $PREVIOUS_TAG_COMMIT $CARGO_TOML_MOST_RECENT_COMMIT |