-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (78 loc) · 2.33 KB
/
Copy pathci.yml
File metadata and controls
82 lines (78 loc) · 2.33 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
name: CI/CD
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
jobs:
validate:
name: Validate Configuration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Validate opencode.json + agents + skills
run: node bin/commands/validate.mjs --verbose
- name: Check migration system integrity
run: node bin/commands/check-migrations.mjs
lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Check formatting
run: npx prettier --check 'bin/**/*.mjs' '*.md' '*.json'
- name: ESLint
run: npx eslint bin/ --ext .mjs,.js
publish:
name: Publish to npm
if: startsWith(github.ref, 'refs/tags/v')
needs: [validate, lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Generate template/ for publish
run: bash scripts/generate-template.sh
- name: Pre-publish validation
run: |
node -e "
const fs = require('fs');
const checks = [
'template/.opencode/agents',
'template/.opencode/skills',
'template/.opencode/commands',
'template/opencode.json',
];
let ok = true;
for (const c of checks) {
if (!fs.existsSync(c)) {
console.error('Missing in template:', c);
ok = false;
}
}
if (ok) console.log('✓ Pre-publish template validation passed');
else process.exit(1);
"
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Post-publish version check
run: |
PUBLISHED=$(npm view opencode-agent-kit version)
echo "Published: v$PUBLISHED"