chore: repo cleanup and security hardening

- Remove stale root files: chain_spec.json, pezkuwi.gbp, publish.log,
  test-asset-hub.toml (moved to .claude/)
- Move publish_batch.sh and publish_crates.sh to scripts/
- Remove hardcoded /home/mamostehp/res/ paths from scripts and comments
  (WALLETS_FILE env var now required, no silent fallback)
- Update .gitignore: add protection entries for regenerable artifacts
  and .claude/ experience files
This commit is contained in:
2026-04-13 21:30:38 +03:00
parent f82546fdb1
commit a683b836fe
9 changed files with 12 additions and 214 deletions
+54
View File
@@ -0,0 +1,54 @@
#!/bin/bash
cd /home/mamostehp/pezkuwi-sdk
LOG="/home/mamostehp/pezkuwi-sdk/publish.log"
publish_crate() {
local crate=$1
echo "$(date -u) - Publishing $crate" | tee -a $LOG
OUTPUT=$(cargo publish -p "$crate" 2>&1)
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "$(date -u) - SUCCESS: $crate" | tee -a $LOG
return 0
elif echo "$OUTPUT" | grep -q "429 Too Many Requests"; then
echo "$(date -u) - RATE LIMITED: $crate - waiting 120s" | tee -a $LOG
sleep 120
# Retry
OUTPUT=$(cargo publish -p "$crate" 2>&1)
if [ $? -eq 0 ]; then
echo "$(date -u) - SUCCESS (retry): $crate" | tee -a $LOG
return 0
fi
elif echo "$OUTPUT" | grep -q "already uploaded"; then
echo "$(date -u) - SKIPPED: $crate (already published)" | tee -a $LOG
return 0
fi
echo "$(date -u) - FAILED: $crate" | tee -a $LOG
echo "$OUTPUT" >> $LOG
return 1
}
# Level 1 crates
CRATES=(
"pezsp-arithmetic"
"pezsp-runtime-interface-proc-macro"
"pezsp-runtime-interface"
"pezsp-io"
"pezsp-core"
"pezsp-keyring"
"pezsp-weights"
"pezsp-version-proc-macro"
"pezsp-version"
"pezsp-application-crypto"
"pezsp-metadata-ir"
)
for crate in "${CRATES[@]}"; do
publish_crate "$crate"
sleep 65
done
echo "Batch complete!" | tee -a $LOG
+74
View File
@@ -0,0 +1,74 @@
#!/bin/bash
# Publish crates with rate limit handling
CRATES=(
# Level 0 remaining
"pezsp-core-hashing-proc-macro"
"pezsp-wasm-interface"
# Level 1
"pezsp-arithmetic"
"pezsp-io"
"pezsp-runtime-interface-proc-macro"
"pezsp-runtime-interface"
"pezsp-core"
"pezsp-keyring"
"pezsp-weights"
"pezsp-version-proc-macro"
"pezsp-version"
"pezsp-application-crypto"
"pezsp-runtime"
"pezsp-staking"
"pezsp-state-machine"
"pezsp-trie"
"pezsp-database"
"pezsp-maybe-compressed-blob"
)
PUBLISHED=0
FAILED=0
for crate in "${CRATES[@]}"; do
echo "========================================"
echo "Publishing: $crate"
echo "Time: $(date -u)"
echo "========================================"
OUTPUT=$(cargo publish -p "$crate" 2>&1)
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "SUCCESS: $crate"
((PUBLISHED++))
elif echo "$OUTPUT" | grep -q "429 Too Many Requests"; then
# Extract wait time
WAIT_UNTIL=$(echo "$OUTPUT" | grep -oP 'after \K[^o]+')
echo "RATE LIMITED - waiting until $WAIT_UNTIL"
echo "Sleeping 120 seconds..."
sleep 120
# Retry
echo "Retrying $crate..."
cargo publish -p "$crate" 2>&1
if [ $? -eq 0 ]; then
echo "SUCCESS on retry: $crate"
((PUBLISHED++))
else
echo "FAILED on retry: $crate"
((FAILED++))
fi
elif echo "$OUTPUT" | grep -q "already uploaded"; then
echo "SKIPPED (already published): $crate"
else
echo "FAILED: $crate"
echo "$OUTPUT"
((FAILED++))
fi
echo "Waiting 65 seconds..."
sleep 65
done
echo "========================================"
echo "SUMMARY"
echo "Published: $PUBLISHED"
echo "Failed: $FAILED"
echo "========================================"