Skip to content

Commit da38a5d

Browse files
Jake FitzgeraldJake Fitzgerald
authored andcommitted
Organize dev and build CI workflows
1 parent 63c296a commit da38a5d

43 files changed

Lines changed: 412 additions & 206 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"description": "CAD, robotics, fabrication, and local review plugins."
88
},
99
"description": "CAD, robotics, fabrication, and local review plugins.",
10-
"version": "0.1.12",
10+
"version": "0.1.13",
1111
"plugins": [
1212
{
1313
"name": "cad",
1414
"source": "./plugins/cad",
1515
"description": "CAD, robotics, fabrication, and local review skills.",
16-
"version": "0.1.12",
16+
"version": "0.1.13",
1717
"author": {
1818
"name": "earthtojake"
1919
},

.github/workflows/check-builds.yml

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,19 @@
1-
name: Test Suite
1+
name: Check Builds
22

33
on:
44
workflow_dispatch:
55
pull_request:
66
branches:
7-
- dev
87
- build-test
98
- main
109
push:
1110
branches:
12-
- dev
1311
- build-test
1412
- main
1513

1614
jobs:
17-
version-check:
18-
name: Version Check
19-
runs-on: ubuntu-latest
20-
21-
steps:
22-
- name: Check out repository
23-
uses: actions/checkout@v4
24-
with:
25-
fetch-depth: 0
26-
27-
- name: Set up Python
28-
uses: actions/setup-python@v5
29-
with:
30-
python-version: "3.12"
31-
32-
- name: Fetch release comparison refs
33-
run: git fetch --no-tags origin main:refs/remotes/origin/main dev:refs/remotes/origin/dev
34-
35-
- name: Check release versions are consistent
36-
run: scripts/release/bump-version.sh --check
37-
38-
- name: Check release version is incremented from comparison base
39-
env:
40-
CURRENT_REF_NAME: ${{ github.ref_name }}
41-
PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
42-
PUSH_BEFORE_SHA: ${{ github.event.before }}
43-
run: |
44-
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
45-
base_ref="$PULL_REQUEST_BASE_SHA"
46-
elif [ "$CURRENT_REF_NAME" = "dev" ]; then
47-
base_ref="origin/main"
48-
elif [ "$CURRENT_REF_NAME" = "build-test" ]; then
49-
base_ref="origin/main"
50-
else
51-
base_ref="$PUSH_BEFORE_SHA"
52-
fi
53-
if [ -z "$base_ref" ] || [ "$base_ref" = "0000000000000000000000000000000000000000" ]; then
54-
echo "No release version comparison base for this event; skipping increment check."
55-
exit 0
56-
fi
57-
scripts/release/bump-version.sh --check-incremented-from "$base_ref"
58-
59-
test-suite:
60-
name: Test Suite
15+
check-builds:
16+
name: Check Builds
6117
runs-on: ubuntu-latest
6218

6319
steps:
@@ -74,20 +30,10 @@ jobs:
7430
with:
7531
node-version: "22"
7632

77-
- name: Install Python dependencies
78-
run: |
79-
python -m pip install --upgrade pip
80-
python -m pip install -r requirements-dev.txt
81-
8233
- name: Install Node dependencies
8334
run: |
8435
npm ci --prefix packages/cadjs
8536
npm ci --prefix viewer
86-
npm ci --prefix docs
8737
88-
- name: Validate materialized release layout
89-
if: github.ref_name == 'main' || github.ref_name == 'build-test' || github.base_ref == 'main' || github.base_ref == 'build-test'
38+
- name: Check materialized build outputs
9039
run: scripts/check/check-materialized.sh
91-
92-
- name: Run repo test suite
93-
run: scripts/test.sh
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Check Version
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- dev
8+
- build-test
9+
- main
10+
push:
11+
branches:
12+
- dev
13+
- build-test
14+
- main
15+
16+
jobs:
17+
check-version:
18+
name: Check Version
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Check out repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: "3.12"
31+
32+
- name: Fetch release comparison refs
33+
run: git fetch --no-tags origin main:refs/remotes/origin/main dev:refs/remotes/origin/dev
34+
35+
- name: Check release version
36+
env:
37+
CURRENT_REF_NAME: ${{ github.ref_name }}
38+
PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
39+
PUSH_BEFORE_SHA: ${{ github.event.before }}
40+
run: |
41+
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
42+
base_ref="$PULL_REQUEST_BASE_SHA"
43+
elif [ "$CURRENT_REF_NAME" = "dev" ]; then
44+
if [ -n "$PUSH_BEFORE_SHA" ] && [ "$PUSH_BEFORE_SHA" != "0000000000000000000000000000000000000000" ]; then
45+
base_ref="$PUSH_BEFORE_SHA"
46+
else
47+
base_ref="origin/main"
48+
fi
49+
elif [ "$CURRENT_REF_NAME" = "build-test" ]; then
50+
base_ref="origin/main"
51+
else
52+
base_ref="$PUSH_BEFORE_SHA"
53+
fi
54+
if [ -z "$base_ref" ] || [ "$base_ref" = "0000000000000000000000000000000000000000" ]; then
55+
scripts/check-version.sh
56+
else
57+
scripts/check-version.sh --incremented-from "$base_ref"
58+
fi

.github/workflows/materialize-build-test.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,16 @@ jobs:
5353
node-version: "22"
5454

5555
- name: Fetch release comparison refs
56-
run: git fetch --no-tags origin main:refs/remotes/origin/main
56+
run: |
57+
git fetch --no-tags origin \
58+
main:refs/remotes/origin/main \
59+
build-test:refs/remotes/origin/build-test
5760
5861
- name: Check release versions are consistent
59-
run: scripts/release/bump-version.sh --check
62+
run: scripts/check-version.sh
6063

6164
- name: Check dev release version is incremented from main
62-
run: scripts/release/bump-version.sh --check-incremented-from origin/main
65+
run: scripts/check-version.sh --incremented-from origin/main
6366

6467
- name: Install Python dependencies
6568
run: |
@@ -73,7 +76,7 @@ jobs:
7376
npm ci --prefix docs
7477
7578
- name: Check dev symlink layout
76-
run: scripts/check/check-dev-symlinks.sh
79+
run: scripts/dev.sh --check
7780

7881
- name: Create local build-test branch
7982
run: git checkout -B build-test "$GITHUB_SHA"
@@ -84,7 +87,7 @@ jobs:
8487
- name: Validate materialized layout
8588
run: scripts/check/check-materialized.sh
8689

87-
- name: Run full repo test suite
90+
- name: Run code tests
8891
run: scripts/test.sh
8992

9093
- name: Commit materialized outputs
@@ -102,18 +105,19 @@ jobs:
102105
echo "committed=true" >> "$GITHUB_OUTPUT"
103106
104107
- name: Push build-test branch
105-
if: steps.commit.outputs.committed == 'true'
106108
run: git push --force-with-lease origin HEAD:build-test
107109

108110
- name: Dispatch build-test checks
109-
if: steps.commit.outputs.committed == 'true' && steps.push-token.outputs.uses_build_test_push_token != 'true'
111+
if: steps.push-token.outputs.uses_build_test_push_token != 'true'
110112
env:
111113
GH_TOKEN: ${{ github.token }}
112114
run: |
113-
curl --fail --show-error --silent \
114-
-X POST \
115-
-H "Authorization: Bearer $GH_TOKEN" \
116-
-H "Accept: application/vnd.github+json" \
117-
-H "X-GitHub-Api-Version: 2022-11-28" \
118-
"https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows/check-builds.yml/dispatches" \
119-
-d '{"ref":"build-test"}'
115+
for workflow in test.yml check-builds.yml check-version.yml; do
116+
curl --fail --show-error --silent \
117+
-X POST \
118+
-H "Authorization: Bearer $GH_TOKEN" \
119+
-H "Accept: application/vnd.github+json" \
120+
-H "X-GitHub-Api-Version: 2022-11-28" \
121+
"https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows/${workflow}/dispatches" \
122+
-d '{"ref":"build-test"}'
123+
done

.github/workflows/test.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Test
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- dev
8+
- build-test
9+
- main
10+
push:
11+
branches:
12+
- dev
13+
- build-test
14+
- main
15+
16+
jobs:
17+
test:
18+
name: Test
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Check out repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.12"
29+
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: "22"
34+
35+
- name: Install Python dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
python -m pip install -r requirements-dev.txt
39+
40+
- name: Install Node dependencies
41+
run: |
42+
npm ci --prefix packages/cadjs
43+
npm ci --prefix viewer
44+
npm ci --prefix docs
45+
46+
- name: Check dev layout
47+
if: github.ref_name == 'dev' || github.base_ref == 'dev'
48+
run: scripts/dev.sh --check
49+
50+
- name: Run code tests
51+
run: scripts/test.sh

AGENTS.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ product and `models/` as the shared fixture/artifact area.
2525
rules and pointers.
2626
- Read `COMMIT.md` before committing, rebasing, resolving generated-file
2727
conflicts, or bumping release versions.
28+
- Branch from `dev` for development and open PRs against `dev`. Keep `dev` in
29+
symlink layout with `scripts/dev.sh`; production users should clone `main`.
2830
- Before committing release metadata for a PR, fetch the base branch and ensure
2931
the branch version is greater than the latest base version; use `COMMIT.md`
3032
for the exact workflow.
@@ -57,7 +59,7 @@ product and `models/` as the shared fixture/artifact area.
5759
- Keep release versioning in lockstep: the git tag, plugin manifests and
5860
`plugins/*/VERSION`, package manifests/locks, Python `pyproject.toml` files,
5961
and any other repo-owned release version numbers should all match. The
60-
current release version is `0.1.12`. Use `scripts/release/bump-version.sh`
62+
current release version is `0.1.13`. Use `scripts/release/bump-version.sh`
6163
for version bumps as described in `COMMIT.md`.
6264

6365
## Environments
@@ -72,7 +74,9 @@ product and `models/` as the shared fixture/artifact area.
7274
Run the smallest path-targeted check that covers the change. Use broad wrappers
7375
when touching shared surfaces or before handoff:
7476

75-
- Full repo validation: `scripts/test.sh`
77+
- Code tests: `scripts/test.sh`
78+
- Development symlink layout: `scripts/dev.sh --check`
79+
- Release version metadata: `scripts/check-version.sh`
7680
- All generated runtime freshness: `scripts/build.sh --check`
7781
- CAD skill or `packages/cadpy`: `scripts/build/build-cad-skill.sh --check`
7882
- Root Viewer package copies: `scripts/build/build-viewer.sh --check`

COMMIT.md

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ or bumping release versions.
1616
the final version bump:
1717

1818
```bash
19-
git fetch origin main --tags
20-
git show origin/main:plugins/cad/VERSION
19+
git fetch origin dev main --tags
20+
git show origin/dev:plugins/cad/VERSION
2121
```
2222

23-
Rebase or merge `origin/main` before bumping release metadata when the base
23+
Rebase or merge the target base before bumping release metadata when the base
2424
branch has advanced. Resolve source files first, regenerate generated
2525
outputs, then run the version bump wrapper.
2626

@@ -51,7 +51,7 @@ or bumping release versions.
5151
scripts/build/build-cad-viewer-skill.sh --check
5252
scripts/build/build-plugin.sh --check
5353
scripts/check/validate-plugins.sh
54-
scripts/release/bump-version.sh --check
54+
scripts/check-version.sh
5555
```
5656

5757
Broaden to `scripts/build.sh --check` or `scripts/test.sh` when touching
@@ -108,8 +108,8 @@ of truth first, then regenerate rather than manually merging generated blobs.
108108
rebase. Then verify:
109109

110110
```bash
111-
scripts/release/bump-version.sh --check
112-
scripts/release/bump-version.sh --check-incremented-from origin/main
111+
scripts/check-version.sh
112+
scripts/check-version.sh --incremented-from origin/main
113113
```
114114

115115
5. Stage resolved files, finish the rebase or merge, and rerun the relevant
@@ -121,33 +121,30 @@ Release versions are intentionally lockstep across the git tag, plugin
121121
manifests, `plugins/*/VERSION`, package manifests and locks, Python
122122
`pyproject.toml` files, generated skill runtimes, plugin package copies, and
123123
repo-owned docs. CI checks that all versions match and that the branch version
124-
is greater than the target `main` commit.
124+
is greater than the target base commit.
125125

126-
Use the wrapper, not ad hoc edits:
126+
For development branches, use the wrapper without creating a local tag:
127127

128128
```bash
129129
scripts/release/bump-version.sh patch --dry-run
130-
scripts/release/bump-version.sh patch
130+
scripts/release/bump-version.sh patch --no-commit
131131
```
132132

133-
Default behavior for bump commands:
134-
135-
- updates every repo-owned version target
136-
- creates a commit with the release metadata changes
137-
- creates a local release tag named exactly like the version, for example
138-
`0.1.7`
133+
That updates every repo-owned version target. Commit those edits with the PR
134+
work. CI checks them with `scripts/check-version.sh`.
139135

140136
Useful variants:
141137

142138
```bash
143139
scripts/release/bump-version.sh patch --amend
144140
scripts/release/bump-version.sh patch --no-commit
145141
scripts/release/bump-version.sh --set-version 0.2.0 --no-commit
146-
scripts/release/bump-version.sh --check
147-
scripts/release/bump-version.sh --check-incremented-from origin/main
142+
scripts/check-version.sh
143+
scripts/check-version.sh --incremented-from origin/main
148144
```
149145

150146
Use `--amend` when the version bump belongs in the current commit. Use
151147
`--no-commit` when you need to combine the bump with other staged work or when
152-
resolving a rebase conflict manually. Push release tags only when the user or
153-
release workflow explicitly asks for tags to be published.
148+
resolving a rebase conflict manually. Create and push release tags only from a
149+
materialized release branch when the user or release workflow explicitly asks
150+
for tags to be published.

0 commit comments

Comments
 (0)