Vendor #76
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: Vendor | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'vendor.py' | |
- 'src/duckdb' | |
workflow_dispatch: | |
schedule: | |
- cron: "17 0 * * *" | |
jobs: | |
vendor: | |
runs-on: ubuntu-latest | |
outputs: | |
sha: ${{ steps.commit.outputs.sha }} | |
did_vendor: ${{ steps.vendor.outputs.vendor }} | |
name: "Update Vendored Sources" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/checkout@v4 | |
with: | |
repository: duckdb/duckdb | |
path: .git/duckdb | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Vendor sources | |
id: vendor | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "DuckDB Labs GitHub Bot" | |
git rm -rf src/duckdb | |
python vendor.py --duckdb .git/duckdb | |
git add src/duckdb CMakeLists.txt | |
rm -rf .git/duckdb | |
export REV=`git rev-parse --short HEAD` | |
git commit -m "Update vendored DuckDB sources to $REV" | |
git push --dry-run | |
# Check if ahead of upstream branch | |
# If yes, set a step output | |
if [ $(git rev-list HEAD...origin/main --count) -gt 0 ]; then | |
# Avoid set-output, it's deprecated | |
echo "vendor=ok" >> "$GITHUB_OUTPUT" | |
fi | |
- if: steps.vendor.outputs.vendor != '' && github.event_name != 'pull_request' | |
run: | | |
git push -u origin HEAD | |
rebuild: | |
needs: vendor | |
if: ${{ needs.vendor.outputs.did_vendor != '' }} | |
uses: ./.github/workflows/ODBC.yml | |
secrets: inherit |