name: models.dev snapshot # The embedded snapshot is the offline/first-run floor for model metadata. The runtime refresh # keeps live installs current, so this only has to move at release cadence — but a fresh clone or # an air-gapped install should still know about models that shipped since the last release. # # Everything is verified *here*, in the job, rather than on the pull request it opens. A PR created # with the default `GITHUB_TOKEN` does not trigger workflows — that is GitHub's loop guard, not a # misconfiguration — so the PR's check list is empty by construction and always will be. Whatever # has to hold before these bytes ship is therefore asserted below, before the PR exists. on: schedule: - cron: "0 6 * * 1" # Mondays, 06:00 UTC workflow_dispatch: permissions: contents: write pull-requests: write # The same build settings as `ci.yml`, which this job used to go without. Regenerating the site # assets lists every test binary in the workspace, and with full debug info that build filled the # runner's disk: the listing came back empty and the job died on a JSON parse, having said nothing # about why. env: CARGO_TERM_COLOR: always CARGO_NET_RETRY: "3" CARGO_PROFILE_DEV_DEBUG: line-tables-only CARGO_PROFILE_TEST_DEBUG: line-tables-only jobs: refresh: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Regenerate the snapshot run: scripts/update-models-snapshot.sh # The script writes deterministic bytes, so an unchanged catalog means there is nothing to # build, test or open. Skip the expensive half rather than spending a release build to # discover it. - name: Did anything change? id: changed run: | if git diff --quiet -- crates/luxe-providers/data/models-dev-snapshot.json.gz; then echo "snapshot unchanged" echo "changed=false" >>"$GITHUB_OUTPUT" else echo "changed=true" >>"$GITHUB_OUTPUT" fi - name: Install Rust if: steps.changed.outputs.changed == 'true' uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 if: steps.changed.outputs.changed == 'true' - name: Install nextest if: steps.changed.outputs.changed == 'true' uses: taiki-e/install-action@26e9283f268b880168bdbd2c545dfcd60ec2c6ab # v2.87.13 with: tool: nextest # What upstream churn actually breaks: a provider id that was renamed, or a preference list # whose first entry was retired, which would hand every new account fallback metadata. Those # live in `luxe-providers`' catalog tests; `luxe-cli` owns resolution on top of them. - name: Verify the catalog still holds if: steps.changed.outputs.changed == 'true' run: cargo nextest run -p luxe-providers -p luxe-cli # `facts.json` counts the snapshot's providers and models, so a refresh makes the generated # site assets stale. Regenerating here keeps the PR self-consistent — shipping the snapshot # alone turns the stale-assets gate red on master the moment it merges. - name: Regenerate the site assets if: steps.changed.outputs.changed == 'true' run: | scripts/site-assets.sh scripts/site-assets.sh --check - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 if: steps.changed.outputs.changed == 'true' with: branch: chore/models-dev-snapshot title: "chore: refresh the embedded models.dev snapshot" commit-message: "chore: refresh the embedded models.dev snapshot" body: | Automated refresh of `crates/luxe-providers/data/models-dev-snapshot.json.gz` from https://models.dev/api.json, with the derived counts in `web/src/assets/generated/facts.json`. Verified in the job that produced it — a PR opened with `GITHUB_TOKEN` gets no workflow runs, so an empty check list here is expected, not a failure: - `cargo nextest run -p luxe-providers -p luxe-cli` - `scripts/site-assets.sh --check` Regenerate locally with `scripts/update-models-snapshot.sh` followed by `scripts/site-assets.sh`. The script writes deterministic bytes, so an unchanged catalog produces no PR. add-paths: | crates/luxe-providers/data/models-dev-snapshot.json.gz web/src/assets/generated/facts.json