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:
- Checkout.
- Nix install + cache.
- soldeer install (gated on
soldeer.lock).
- Run a repo-specific meta-build prelude (a
nix run .#<task> that invokes the rain CLI to produce meta/*.rain.meta).
- Run
script/BuildPointers.sol (where present) to regenerate src/generated/*.pointers.sol.
- Optional: run
script/CopyArtifacts.sol (where present) to regenerate crates/*/abi/*.json.
- Run
forge fmt.
- 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.
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-artifactsworkflow ends up doing the same orchestration:soldeer.lock).nix run .#<task>that invokes therainCLI to producemeta/*.rain.meta).script/BuildPointers.sol(where present) to regeneratesrc/generated/*.pointers.sol.script/CopyArtifacts.sol(where present) to regeneratecrates/*/abi/*.json.forge fmt.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 landrainix-build-pointers.yamlcovers step 5 only and assumes no prelude.What to ship
rainix-regen-check.yaml(name TBD) reusable workflow with inputs:Consumer reduces to a 6-line wrapper.
Relationship to existing issues
LibCopyArtifacts) — separate layer, the shared library used by the abi-copy script.rainix-copy-artifacts.yaml) — abi-copy specific. This issue could absorb Ship a rainix-copy-artifacts.yaml reusable workflow #169 by making the abi step optional in the unified workflow. Either way they should ship together.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.