Skip to content

Commit e9c6424

Browse files
author
sangjanai
committed
chore: add upstream sync workflow
1 parent eadd802 commit e9c6424

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Sync with Latest Release
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # Runs daily at midnight UTC
6+
workflow_dispatch: # Allow manual triggering
7+
8+
jobs:
9+
sync-with-release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0 # Get full history for commit count
16+
17+
- name: Add upstream remote
18+
run: |
19+
git remote add upstream https://github.com/ggml-org/llama.cpp.git
20+
git fetch upstream --tags # Fetch tags from upstream
21+
22+
- name: Sync master with latest release
23+
run: |
24+
git checkout master
25+
LATEST_RELEASE=$(git describe --tags --abbrev=0 upstream/master)
26+
git reset --hard $LATEST_RELEASE
27+
git push origin master --force
28+
29+
- name: Rebase dev onto master
30+
run: |
31+
git checkout dev
32+
if ! git rebase master; then
33+
echo "Rebase conflict detected, aborting"
34+
git rebase --abort
35+
exit 1
36+
fi
37+
git push origin dev --force-with-lease
38+
39+
- name: Create version tag
40+
run: |
41+
git checkout master
42+
COMMIT_COUNT=$(git rev-list --count HEAD)
43+
git checkout dev
44+
git tag "b${COMMIT_COUNT}"
45+
git push origin tag "b${COMMIT_COUNT}"

0 commit comments

Comments
 (0)