Require versions.env, add rev updater, and externalize Docker args

This commit is contained in:
andrussal 2025-12-09 17:24:11 +01:00
parent 0835669898
commit 78f38f4ca0
6 changed files with 45 additions and 14 deletions

View File

@ -5,8 +5,6 @@ on:
env:
CARGO_TERM_COLOR: always
NOMOS_NODE_REV: d2dd5a5084e1daef4032562c77d41de5e4d495f8
NOMOS_BUNDLE_VERSION: v4
jobs:
build_nomos_binaries:
@ -37,7 +35,7 @@ jobs:
sudo apt-get install -y clang llvm-dev libclang-dev pkg-config cmake libssl-dev rsync libgmp10 libgmp-dev libgomp1 nasm
- name: Install nomos circuits
run: |
./scripts/setup-nomos-circuits.sh v0.3.1 "$NOMOS_CIRCUITS"
./scripts/setup-nomos-circuits.sh "${VERSION}" "$NOMOS_CIRCUITS"
echo "NOMOS_CIRCUITS=$NOMOS_CIRCUITS" >> "$GITHUB_ENV"
- name: Add top-level KZG params file
run: |

View File

@ -7,8 +7,6 @@ on:
env:
CARGO_TERM_COLOR: always
NOMOS_NODE_REV: d2dd5a5084e1daef4032562c77d41de5e4d495f8
NOMOS_BUNDLE_VERSION: v4
permissions:
actions: read
contents: read
@ -31,7 +29,7 @@ jobs:
fi
- name: Install nomos circuits
run: |
./scripts/setup-nomos-circuits.sh v0.3.1 "$HOME/.nomos-circuits"
./scripts/setup-nomos-circuits.sh "${VERSION}" "$HOME/.nomos-circuits"
echo "NOMOS_CIRCUITS=$HOME/.nomos-circuits" >> "$GITHUB_ENV"
- uses: dtolnay/rust-toolchain@master
with:
@ -62,7 +60,7 @@ jobs:
fi
- name: Install nomos circuits
run: |
./scripts/setup-nomos-circuits.sh v0.3.1 "$HOME/.nomos-circuits"
./scripts/setup-nomos-circuits.sh "${VERSION}" "$HOME/.nomos-circuits"
echo "NOMOS_CIRCUITS=$HOME/.nomos-circuits" >> "$GITHUB_ENV"
- uses: dtolnay/rust-toolchain@master
with:
@ -93,7 +91,7 @@ jobs:
fi
- name: Install nomos circuits
run: |
./scripts/setup-nomos-circuits.sh v0.3.1 "$HOME/.nomos-circuits"
./scripts/setup-nomos-circuits.sh "${VERSION}" "$HOME/.nomos-circuits"
echo "NOMOS_CIRCUITS=$HOME/.nomos-circuits" >> "$GITHUB_ENV"
- uses: dtolnay/rust-toolchain@master
with:

View File

@ -32,6 +32,9 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if [ -f "${ROOT_DIR}/versions.env" ]; then
# shellcheck disable=SC1091
. "${ROOT_DIR}/versions.env"
else
echo "ERROR: versions.env missing; run from repo root or restore the file." >&2
exit 1
fi
DEFAULT_VERSION="${VERSION:-v0.3.1}"
DEFAULT_NODE_REV="${NOMOS_NODE_REV:-d2dd5a5084e1daef4032562c77d41de5e4d495f8}"

View File

@ -59,10 +59,12 @@ if [ -n "${NOMOS_BINARIES_TAR:-}" ] && [ ! -f "${NOMOS_BINARIES_TAR}" ]; then
fi
readonly ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if [ -f "${ROOT_DIR}/versions.env" ]; then
# shellcheck disable=SC1091
. "${ROOT_DIR}/versions.env"
if [ ! -f "${ROOT_DIR}/versions.env" ]; then
echo "ERROR: versions.env missing; run from repo root or restore the file." >&2
exit 1
fi
# shellcheck disable=SC1091
. "${ROOT_DIR}/versions.env"
if [ -f "${ROOT_DIR}/paths.env" ]; then
# shellcheck disable=SC1091
. "${ROOT_DIR}/paths.env"

View File

@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -euo pipefail
# Update nomos-node revision across versions.env and Cargo.toml.
# Usage: scripts/update-nomos-rev.sh <new_rev>
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <new_nomós_node_rev>" >&2
exit 1
fi
NEW_REV="$1"
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if [ ! -f "${ROOT_DIR}/versions.env" ]; then
echo "ERROR: versions.env missing; run from repo root." >&2
exit 1
fi
echo "Updating nomos-node rev to ${NEW_REV}"
# Update versions.env NOMOS_NODE_REV entry (keep other lines intact).
sed -i.bak -E "s/^NOMOS_NODE_REV=.*/NOMOS_NODE_REV=${NEW_REV}/" "${ROOT_DIR}/versions.env"
rm -f "${ROOT_DIR}/versions.env.bak"
# Update all rev fields in Cargo.toml pointing to nomos-node.
sed -i.bak -E "s/(git = \"https:\/\/github.com\/logos-co\/nomos-node\.git\", rev = \")[^\"]+(\".*)/\1${NEW_REV}\2/" "${ROOT_DIR}/Cargo.toml"
rm -f "${ROOT_DIR}/Cargo.toml.bak"
echo "Done. Consider updating Cargo.lock if needed (cargo fetch)."

View File

@ -2,10 +2,10 @@
# check=skip=SecretsUsedInArgOrEnv
# Ignore warnings about sensitive information as this is test data.
ARG VERSION=v0.3.1
ARG VERSION
ARG CIRCUITS_OVERRIDE
ARG NOMOS_NODE_REV=d2dd5a5084e1daef4032562c77d41de5e4d495f8
ARG CIRCUITS_PLATFORM=linux-x86_64
ARG NOMOS_NODE_REV
ARG CIRCUITS_PLATFORM
# ===========================
# BUILD IMAGE