-
-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (142 loc) · 5.88 KB
/
Copy pathrelease.yml
File metadata and controls
163 lines (142 loc) · 5.88 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Release
on:
workflow_run:
workflows: ["Validate Skills"]
types: [completed]
branches: [main]
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
outputs:
published: ${{ steps.changesets.outputs.published }}
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
cache: npm
registry-url: https://registry.npmjs.org
- run: npm ci
- name: Build skills.zip
run: npm run build
- name: Create Release PR or Publish
id: changesets
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1
with:
publish: npx changeset publish --provenance
title: "chore: version packages"
commit: "chore: version packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true
- name: Upload skills.zip as release asset
if: steps.changesets.outputs.published == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(node -p "require('./package.json').version")
TAG="v${VERSION}"
# Create GitHub release with skills.zip if tag exists
if gh release view "$TAG" >/dev/null 2>&1; then
gh release upload "$TAG" dist/skills.zip --clobber
echo "Uploaded skills.zip to release $TAG ✅"
else
gh release create "$TAG" dist/skills.zip --generate-notes
echo "Created release $TAG with skills.zip ✅"
fi
- name: Register skills on skills.sh
if: steps.changesets.outputs.published == 'true'
run: |
npx -y skills add marcfargas/skills --full-depth --all 2>&1 || echo "⚠️ skills.sh registration failed (non-blocking)"
echo "skills.sh registration done ✅"
verify-publish:
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.published == 'true'
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
- name: Wait for npm registry propagation
run: |
VERSION=$(node -p "require('./package.json').version")
echo "Waiting for @marcfargas/skills@${VERSION} to appear on npm..."
for i in $(seq 1 30); do
if npm view "@marcfargas/skills@${VERSION}" version 2>/dev/null; then
echo "Package available on npm ✅"
exit 0
fi
echo " Attempt $i/30 — waiting 10s..."
sleep 10
done
echo "❌ Package not found on npm after 5 minutes"
exit 1
- name: Verify skills add — default discovery from npm
run: |
set -e
echo "=== Default: npx skills add marcfargas/skills --list ==="
export HOME=$(mktemp -d)
DEFAULT_OUTPUT=$(npx -y skills add marcfargas/skills --list 2>&1) || true
echo "$DEFAULT_OUTPUT"
DEFAULT_COUNT=$(echo "$DEFAULT_OUTPUT" | grep -oP 'Found \K[0-9]+' || echo "0")
echo "Default discovery: $DEFAULT_COUNT skill(s)"
echo ""
echo "=== Full-depth: npx skills add marcfargas/skills --list --full-depth ==="
FULL_OUTPUT=$(npx -y skills add marcfargas/skills --list --full-depth 2>&1) || true
echo "$FULL_OUTPUT"
FULL_COUNT=$(echo "$FULL_OUTPUT" | grep -oP 'Found \K[0-9]+' || echo "0")
echo "Full-depth discovery: $FULL_COUNT skill(s)"
echo "Discovery baseline from npm captured ✅"
- name: Verify skills add — install all from npm
run: |
set -e
export HOME=$(mktemp -d)
OUTPUT=$(npx -y skills add marcfargas/skills --full-depth --all 2>&1) || true
echo "$OUTPUT"
SKILL_NAMES=$(find . -name SKILL.md -not -path './.changeset/*' -not -path '*/node_modules/*' | while read f; do
sed -n '/^---$/,/^---$/p' "$f" | grep '^name:' | head -1 | sed 's/^name:\s*//'
done)
FAILED=0
for name in $SKILL_NAMES; do
if echo "$OUTPUT" | grep -qi "$name"; then
echo " ✅ $name installed from npm"
else
echo " ❌ $name NOT found"
FAILED=1
fi
done
if [ "$FAILED" -eq 1 ]; then
echo "⚠️ Some skills not detected in output (may be CLI limitation)"
fi
echo "npm install smoke test done ✅"
- name: Verify skills add — each skill individually from npm
run: |
set -e
SKILL_NAMES=$(find . -name SKILL.md -not -path './.changeset/*' -not -path '*/node_modules/*' | while read f; do
sed -n '/^---$/,/^---$/p' "$f" | grep '^name:' | head -1 | sed 's/^name:\s*//'
done)
FAILED=0
for name in $SKILL_NAMES; do
export HOME=$(mktemp -d)
OUTPUT=$(npx -y skills add marcfargas/skills --skill "$name" --full-depth --all 2>&1) || true
if echo "$OUTPUT" | grep -qi "$name"; then
echo " ✅ skills add --skill $name (from npm)"
else
echo " ❌ skills add --skill $name FAILED (from npm)"
echo "$OUTPUT" | tail -5
FAILED=1
fi
done
if [ "$FAILED" -eq 1 ]; then
echo "❌ Some individual skill installs from npm failed"
exit 1
fi
echo "All individual skill installs from npm verified ✅"