Skip to content

Commit

Permalink
Chore: refactor publish workflow for sqlglotrs releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
georgesittas committed May 4, 2024
1 parent 6c61ebb commit 0deffd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
- uses: actions/checkout@v3
- id: check_deploy
name: Check if sqlglotrs should be deployed
run: bash ./.github/workflows/should_deploy_sqlglotrs.sh
run: |
bash ./.github/workflows/should_deploy_sqlglotrs.sh
if [ $? -eq 0 ]; then exit 1; fi
build-rs:
needs: should-deploy-rs
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/should_deploy_sqlglotrs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ 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
exit $(git merge-base --is-ancestor $PREVIOUS_TAG_COMMIT $CARGO_TOML_MOST_RECENT_COMMIT)
SHOULD_DEPLOY=$(git merge-base --is-ancestor $PREVIOUS_TAG_COMMIT $CARGO_TOML_MOST_RECENT_COMMIT)

# Print the SHOULD_DEPLOY variable for debugging purposes
echo "SHOULD_DEPLOY: $SHOULD_DEPLOY"
exit $SHOULD_DEPLOY

0 comments on commit 0deffd8

Please sign in to comment.