-
-
Notifications
You must be signed in to change notification settings - Fork 106
75 lines (67 loc) · 2.18 KB
/
sync-lucli-module.yml
File metadata and controls
75 lines (67 loc) · 2.18 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Sync LuCLI Module
on:
push:
branches: [develop]
paths:
- 'cli/lucli/**'
- 'cli/src/templates/**'
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
# Module sync should not block CI — PAT may expire independently
continue-on-error: true
steps:
- name: Checkout wheels repo
uses: actions/checkout@v4
with:
path: wheels
- name: Checkout distribution repo
uses: actions/checkout@v4
with:
repository: wheels-dev/wheels-cli-lucli
token: ${{ secrets.WHEELS_DEV_PAT }}
path: dist
- name: Sync module files
run: |
# Module core: mirror cli/lucli/ → dist root (delete stale files)
rsync -av --del \
--exclude='PLAN.md' \
wheels/cli/lucli/ dist/
# Bundle codegen templates for standalone installation
mkdir -p dist/templates/codegen
rsync -av --del \
wheels/cli/src/templates/ dist/templates/codegen/
- name: Read module version
id: version
run: |
VERSION=$(jq -r .version dist/module.json)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Commit and push if changed
working-directory: dist
env:
MODULE_VERSION: ${{ steps.version.outputs.version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
if git diff --cached --quiet; then
echo "No module changes to sync"
else
SHORT_SHA="${GITHUB_SHA:0:7}"
git commit -m "Sync from wheels@${SHORT_SHA} (v${MODULE_VERSION})"
git push
fi
- name: Tag release if version changed
working-directory: dist
env:
MODULE_VERSION: ${{ steps.version.outputs.version }}
run: |
TAG="v${MODULE_VERSION}"
if ! git tag -l "$TAG" | grep -q "$TAG"; then
git tag "$TAG"
git push origin "$TAG"
echo "Tagged release $TAG"
else
echo "Tag $TAG already exists, skipping"
fi