-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (82 loc) · 2.77 KB
/
Copy pathci.yml
File metadata and controls
95 lines (82 loc) · 2.77 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: PR Check
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
# ── CLI 可用性 ──
- name: CLI --help
run: node bin/cli.js --help
- name: CLI --help (zh-CN)
run: node bin/cli.js --lang zh-CN --help
- name: CLI create-project alias --help
run: node bin/create-project.js --help
# ── Tarball 构建 ──
- name: npm pack
run: npm pack
# ── Tarball 内容完整性 ──
- name: Verify tarball contents
shell: bash
run: |
PACKAGE=$(ls *.tgz)
echo "Tarball: $PACKAGE"
errors=0
# 将 tar 列表写入临时文件,避免 pipe+grep 的兼容性问题
tar -tzf "$PACKAGE" > /tmp/tarlist.txt
for file in \
"package/bin/cli.js" \
"package/bin/create-project.js" \
"package/.gitattributes" \
"package/package.json" \
"package/template/AGENTS.md" \
"package/template/openspec/schemas/superpowers-bridge-opencode/schema.yaml" \
"package/template/skills.lock.json" \
"package/template/_gitignore" \
"package/template/.editorconfig" \
"package/template/.gitattributes" \
"package/scripts/setup.sh" \
"package/scripts/setup.ps1" \
"package/docs/QUICKSTART.md" \
"package/LICENSE"; do
if grep -q "$file" /tmp/tarlist.txt; then
echo " ✅ $file"
else
echo " ❌ $file"
errors=$((errors + 1))
fi
done
# 验证 template/.opencode/ 结构
echo ""
echo "--- template/.opencode/ structure ---"
grep "package/template/\.opencode/" /tmp/tarlist.txt | head -5
if [ $errors -gt 0 ]; then
echo ""
echo "❌ $errors critical file(s) missing from tarball"
exit 1
fi
echo ""
echo "✅ All critical files present"
# ── CRLF 检查(仅 Linux,Windows 上 xxd 不可用)──
- name: CRLF check (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
PACKAGE=$(ls *.tgz)
tar -xzf "$PACKAGE" -C /tmp package/scripts/setup.sh
if xxd /tmp/package/scripts/setup.sh | head -1 | grep -q "0d 0a"; then
echo "❌ scripts/setup.sh has CRLF — check .gitattributes"
exit 1
else
echo "✅ scripts/setup.sh is LF only"
fi