Skip to content

Commit

Permalink
ci: Bring back stepwise vendoring
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Oct 19, 2024
1 parent e05dcf8 commit 640f15f
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions .github/workflows/vendor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,29 @@ jobs:

- uses: ./.github/workflows/git-identity

- name: Check out or create vendor branch
- name: Vendor sources
id: vendor
run: |
set -x
if ! git checkout vendor; then
git checkout -b vendor
git push -u origin HEAD
git pull --rebase
./vendor-one.sh .git/duckdb
rm -rf .git/duckdb
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
- name: Vendor sources
- name: Create PR
if: steps.vendor.outputs.vendor != ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push --dry-run
# Repeat indefinitely until all commits have been vendored
# https://stackoverflow.com/a/13252187/946850
while :; do
./vendor-one.sh .git/duckdb
# Check if ahead of upstream branch
# If yes, push and run workflow
if [ $(git rev-list HEAD...origin/vendor --count) -gt 0 ]; then
git push -u origin HEAD
gh workflow run rcc -f ref=vendor
else
break
fi
done
rm -rf .git/duckdb
set -x
git checkout -b vendor
if git push -u origin HEAD; then
gh pr create --fill-first
gh workflow run rcc -f ref=vendor
gh pr merge --auto --squash
fi

0 comments on commit 640f15f

Please sign in to comment.