Skip to content

Upstream a regen-derived-artifacts-and-assert-clean-tree reusable workflow #173

@thedavidmeister

Description

@thedavidmeister

A generic "regen-all-derived-artifacts-and-assert-clean-tree" reusable workflow keeps surfacing as inline-duplicated per repo. Each consumer's git-clean / copy-artifacts workflow ends up doing the same orchestration:

  1. Checkout.
  2. Nix install + cache.
  3. soldeer install (gated on soldeer.lock).
  4. Run a repo-specific meta-build prelude (a nix run .#<task> that invokes the rain CLI to produce meta/*.rain.meta).
  5. Run script/BuildPointers.sol (where present) to regenerate src/generated/*.pointers.sol.
  6. Optional: run script/CopyArtifacts.sol (where present) to regenerate crates/*/abi/*.json.
  7. Run forge fmt.
  8. Assert git diff --exit-code.

Current duplicates:

  • rain.math.float/.github/workflows/copy-artifacts.yaml (no meta, has pointers + abi)
  • rainlang/.github/workflows/copy-artifacts.yaml (meta + pointers + abi)
  • rain.flare/.github/workflows/git-clean.yaml (meta + pointers, no abi) — about to land

rainix-build-pointers.yaml covers step 5 only and assumes no prelude.

What to ship

rainix-regen-check.yaml (name TBD) reusable workflow with inputs:

inputs:
  prelude:
    type: string
    required: false
    default: ""
    description: Optional name of a `nix run .#<name>` task to run before the build (e.g. for meta regen via the rain CLI).
  pointers:
    type: boolean
    default: true
  copy-artifacts:
    type: boolean
    default: false

Consumer reduces to a 6-line wrapper.

Relationship to existing issues

Migration

Land the reusable, then port float, rainlang, and rain.flare from their local copies. Leaving any of them on a local copy defeats the purpose.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions