Chore: Add version consistency check to build process

This commit is contained in:
2026-02-17 14:40:35 -08:00
parent 76be84b487
commit 170de52e6b
2 changed files with 28 additions and 6 deletions

View File

@@ -1,9 +1,12 @@
# Build the plug using local deno
build:
deno task build
# Check version consistency
check-versions:
./check_versions.sh
# Build the plug using a Docker container with Deno
build: check-versions
docker run --rm -v /home/sstent/Projects/silverbullet-icalendar:/app -w /app denoland/deno:latest task build
# Helper to build and copy to a local test space (if needed)
deploy-test:
deno task build
deploy-test: build
mkdir -p test_space/_plug
cp icalendar.plug.js test_space/_plug/
cp icalendar.plug.js test_space/_plug/

19
check_versions.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
# Extract versions
TS_VERSION=$(grep "const VERSION =" icalendar.ts | cut -d'"' -f2)
YAML_VERSION=$(grep "version:" icalendar.plug.yaml | head -n 1 | awk '{print $2}')
PLUG_MD_VERSION=$(grep "version:" PLUG.md | head -n 1 | awk '{print $2}')
echo "Checking versions..."
echo "icalendar.ts: $TS_VERSION"
echo "icalendar.plug.yaml: $YAML_VERSION"
echo "PLUG.md: $PLUG_MD_VERSION"
if [ "$TS_VERSION" == "$YAML_VERSION" ] && [ "$YAML_VERSION" == "$PLUG_MD_VERSION" ]; then
echo "✅ All versions match."
exit 0
else
echo "❌ Version mismatch detected!"
exit 1
fi