-
Notifications
You must be signed in to change notification settings - Fork 24
175 lines (165 loc) · 6.08 KB
/
split.yml
File metadata and controls
175 lines (165 loc) · 6.08 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
164
165
166
167
168
169
170
171
172
173
174
175
name: Split packages
on:
push:
branches: ['main']
tags: ['v*']
permissions:
contents: write
#env:
# GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
jobs:
split:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
# Generated from packages.json - DO NOT EDIT MANUALLY
- local: 'packages/addons'
repo: 'cognesy/instructor-addons'
name: 'instructor-addons'
- local: 'packages/agent-ctrl'
repo: 'cognesy/instructor-agent-ctrl'
name: 'instructor-agent-ctrl'
- local: 'packages/auxiliary'
repo: 'cognesy/instructor-aux'
name: 'instructor-aux'
- local: 'packages/config'
repo: 'cognesy/instructor-config'
name: 'instructor-config'
- local: 'packages/doctor'
repo: 'cognesy/instructor-doctor'
name: 'instructor-doctor'
- local: 'packages/dynamic'
repo: 'cognesy/instructor-dynamic'
name: 'instructor-dynamic'
- local: 'packages/evals'
repo: 'cognesy/instructor-evals'
name: 'instructor-evals'
- local: 'packages/events'
repo: 'cognesy/instructor-events'
name: 'instructor-events'
- local: 'packages/http-client'
repo: 'cognesy/instructor-http-client'
name: 'instructor-http-client'
- local: 'packages/hub'
repo: 'cognesy/instructor-hub'
name: 'instructor-hub'
- local: 'packages/instructor'
repo: 'cognesy/instructor-struct'
name: 'instructor-struct'
- local: 'packages/laravel'
repo: 'cognesy/instructor-laravel'
name: 'instructor-laravel'
- local: 'packages/logging'
repo: 'cognesy/instructor-logging'
name: 'instructor-logging'
- local: 'packages/messages'
repo: 'cognesy/instructor-messages'
name: 'instructor-messages'
- local: 'packages/metrics'
repo: 'cognesy/instructor-metrics'
name: 'instructor-metrics'
- local: 'packages/pipeline'
repo: 'cognesy/instructor-pipeline'
name: 'instructor-pipeline'
- local: 'packages/polyglot'
repo: 'cognesy/instructor-polyglot'
name: 'instructor-polyglot'
- local: 'packages/schema'
repo: 'cognesy/instructor-schema'
name: 'instructor-schema'
- local: 'packages/setup'
repo: 'cognesy/instructor-setup'
name: 'instructor-setup'
- local: 'packages/stream'
repo: 'cognesy/instructor-stream'
name: 'instructor-stream'
- local: 'packages/tell'
repo: 'cognesy/instructor-tell'
name: 'instructor-tell'
- local: 'packages/templates'
repo: 'cognesy/instructor-templates'
name: 'instructor-templates'
- local: 'packages/utils'
repo: 'cognesy/instructor-utils'
name: 'instructor-utils'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for proper splitting
# Use centralized release notes from docs/release-notes
- name: Prepare release notes
if: github.ref_type == 'tag'
id: prepare_notes
run: |
TAG_NAME=${{ github.ref_name }}
# Release notes are centralized in docs/release-notes/
CENTRAL_NOTES="docs/release-notes/${TAG_NAME}.mdx"
if [ -f "$CENTRAL_NOTES" ]; then
echo "NOTES_PATH=$CENTRAL_NOTES" >> $GITHUB_ENV
echo "Using centralized release notes from $CENTRAL_NOTES"
else
echo "Warning: No release notes found at $CENTRAL_NOTES"
echo "NOTES_PATH=" >> $GITHUB_ENV
fi
# ► push branch + tag
- name: Split Monorepo
uses: "danharrin/monorepo-split-github-action@v2.3.0"
env:
GITHUB_TOKEN: ${{ secrets.SPLIT_TOKEN_4 }}
with:
#github_token: ${{ secrets.SPLIT_TOKEN_4 }} # PAT here
tag: ${{ github.ref_type == 'tag' && github.ref_name || '' }}
branch: ${{ github.ref_type == 'branch' && github.ref_name || '' }}
package_directory: ${{ matrix.package.local }}
repository_organization: cognesy
repository_name: ${{ matrix.package.name }}
user_name: 'ddebowczyk'
user_email: 'ddebowczyk@gmail.com'
# ► create GitHub Release with notes
- uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag' && env.NOTES_PATH != ''
env:
GITHUB_TOKEN: ${{ secrets.SPLIT_TOKEN_4 }}
with:
repository: ${{ matrix.package.repo }} # target repo
tag_name: ${{ github.ref_name }} # v1.2.3
body_path: ${{ env.NOTES_PATH }}
token: ${{ secrets.SPLIT_TOKEN_4 }} # PAT here
wait-for-packagist:
needs: split
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- name: Wait for Packagist
run: |
# Wait 1 minute(s) for Packagist to update
sleep 60
echo "Waited for Packagist to update"
tests:
needs: wait-for-packagist
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: ['8.2', '8.3', '8.4']
composer: ['--prefer-stable']
steps:
- name: Install dependencies in all packages
run: |
for dir in packages/*; do
if [ -f "$dir/composer.json" ]; then
echo "📦 Installing dependencies in $dir"
composer --working-dir="$dir" update --no-interaction ${{ matrix.composer }}
fi
done
- name: Run tests in all packages
run: |
for dir in packages/*; do
if [ -f "$dir/composer.json" ]; then
echo "🔍 Running tests in $dir"
composer --working-dir="$dir" test
fi
done