forked from shader-slang/shader-slang.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (49 loc) · 1.87 KB
/
sync-stable-branch.yml
File metadata and controls
55 lines (49 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Sync Stable Branch with Slang Release
on:
schedule:
# Run at 3:00 AM UTC every day
- cron: '0 3 * * *'
workflow_dispatch: # Allow manual trigger
jobs:
sync-stable-branch:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main # Explicitly checkout main
# Fetch all history for all branches and tags
fetch-depth: 0
# Get submodules, but don't update them yet
submodules: 'recursive'
- name: Set up Git
run: |
git config --global user.name 'Read the Docs Bot'
git config --global user.email 'rtd-bot@shader-slang.com'
- name: Get latest slang release tag
id: slang_latest_tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Provide token explicitly for gh
run: |
LATEST_TAG=$(gh release view --repo shader-slang/slang --json tagName --jq .tagName)
if [ -z "$LATEST_TAG" ]; then
echo "Failed to fetch latest slang release tag using gh"
exit 1
fi
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
echo "Fetched latest slang tag: $LATEST_TAG"
- name: Update slang submodule to latest release tag
run: |
pushd docs/external/slang
git fetch --tags origin
git checkout ${{ steps.slang_latest_tag.outputs.tag }}
popd
echo "Checked out tag ${{ steps.slang_latest_tag.outputs.tag }} in docs/external/slang"
- name: Commit and push changes to stable branch
run: |
git add docs/external/slang
git commit -m "Sync stable to release (slang@${{ steps.slang_latest_tag.outputs.tag }})"
git push origin HEAD:stable --force
echo "Committed and force-pushed updates to stable branch."