From 953d80ee991b414ed0b4602e1e0412a05abaaecd Mon Sep 17 00:00:00 2001 From: David Meister Date: Sat, 30 May 2026 05:01:30 +0000 Subject: [PATCH] copy-artifacts: regenerate meta via consumer-provided build-meta.sh hook Add a `script/build-meta.sh` hook step between soldeer install and BuildPointers so the reusable currency-checks committed authoring-meta artifacts the same way it checks pointers and abis. The script is consumer-provided because rain meta build's invocation (input/output filenames, meta type) varies per repo. Without this, consumers needed a bespoke git-clean workflow to catch stale meta files; this lets them drop it. Resolves #207. Co-Authored-By: Claude Opus 4.7 --- .github/workflows/rainix-copy-artifacts.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rainix-copy-artifacts.yaml b/.github/workflows/rainix-copy-artifacts.yaml index 228e5bf..5feee87 100644 --- a/.github/workflows/rainix-copy-artifacts.yaml +++ b/.github/workflows/rainix-copy-artifacts.yaml @@ -37,10 +37,14 @@ jobs: - name: Install soldeer dependencies if: hashFiles('soldeer.lock') != '' run: nix develop github:rainlanguage/rainix#sol-shell -c forge soldeer install - # No prelude/codegen step on purpose: committing the generated artifacts - # (meta, pointers, abi) is exactly what lets consumers build without a - # prelude. This job rebuilds from the committed sources and asserts the - # committed artifacts still match — it does not regenerate meta inputs. + # Currency-check every committed generated artifact by re-running each + # consumer-provided codegen step. The final git diff fails if any + # committed file has drifted from its source. The build-meta.sh hook is + # consumer-supplied because rain meta build's invocation (input/output + # filenames, meta type) varies per repo. + - name: Regenerate meta artifacts + if: hashFiles('script/build-meta.sh') != '' + run: nix develop github:rainlanguage/rainix#sol-shell -c ./script/build-meta.sh - name: Regenerate pointer artifacts if: hashFiles('script/BuildPointers.sol') != '' run: nix develop github:rainlanguage/rainix#sol-shell -c forge script ./script/BuildPointers.sol @@ -54,6 +58,6 @@ jobs: - name: Assert committed artifacts match freshly built run: | if ! git diff --exit-code; then - echo "::error::Committed meta/pointer/abi artifacts are stale. Regenerate (.#prelude, BuildPointers.sol, CopyArtifacts.sol, forge fmt) and commit." + echo "::error::Committed meta/pointer/abi artifacts are stale. Regenerate (script/build-meta.sh, script/BuildPointers.sol, script/CopyArtifacts.sol, forge fmt) and commit." exit 1 fi