Skip to content

ci: Remove the previous build before building generated models - #13

Merged
howaskew merged 1 commit into
mainfrom
ci/clean-lib-before-build
Oct 29, 2026
Merged

howaskew merged 1 commit into
mainfrom
ci/clean-lib-before-build

Conversation

@howaskew

Copy link
Copy Markdown
Contributor

Merging releases 1.0.7 to npm (the current models, without the pending update in #5).

Summary

The Update Data Model workflow builds the generated models into lib/, which is committed and published. tsc never deletes output, so compiled files for models that no longer exist stay in lib/. The current update (#5) removes src/schema/Quantity.ts (schema.org 30.1 made Quantity a data type) and renames the test interface's OpportunityAttendanceUpdateSimulateAction to AttendeeAbsentSimulateAction, but leaves their compiled .js and .d.ts files in lib/.

This adds a step that removes lib/ in the runner before the build.

Why this is safe

The step only affects the runner's copy of the repository. The job then builds and runs the tests, and only creates or updates the pull request if both succeed. If the build or tests fail, the job stops and nothing is pushed, so the repository is never left without a lib/. The publish workflow is unchanged.

Verification

  • actionlint: no issues.
  • A clean build of Update data models #5's content: 0 errors, and the output differs from Update data models #5's committed lib/ only by the four orphaned files (lib/schema/Quantity.{js,d.ts}, lib/oa/OpportunityAttendanceUpdateSimulateAction.{js,d.ts}); every other file is identical.

After merging

Run Update Data Model again so #5 is regenerated without the orphaned files, then merge #5.

When squash-merging, check the suggested commit message does not contain a skip-CI marker.

tsc does not delete output, and lib/ is committed, so compiled files
for models that no longer exist stayed in lib/ and were published.
After data-models 3.0.11, lib/schema/Quantity and
lib/oa/OpportunityAttendanceUpdateSimulateAction remained although
their sources were removed.

Remove lib/ in the runner before building. If the build or tests fail,
the job stops before creating a pull request, so the repository is
never left without a lib/. A clean build of the current update differs
from the committed lib/ only by those four orphaned files.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@howaskew
howaskew requested a review from hkir-dev October 28, 2026 11:04
@howaskew
howaskew merged commit 63d01ee into main Oct 29, 2026
3 checks passed
@howaskew
howaskew deleted the ci/clean-lib-before-build branch October 29, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants