-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
22 lines (21 loc) · 948 Bytes
/
Copy pathMakefile
File metadata and controls
22 lines (21 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.PHONY: tag-sensors
# Release all sensors at once by running: make tag-sensors VERSION=v2.1.0
tag-sensors:
@if [ -z "$(VERSION)" ]; then \
echo "❌ Error: VERSION is not set. Usage: make tag-sensors VERSION=v2.1.0"; \
exit 1; \
fi
@$(eval CLEAN_VERSION := $(patsubst v%,%,$(VERSION)))
@echo "🏷️ Tagging all official sensors with v$(CLEAN_VERSION)..."
@for f in $$(find Sensors/official -mindepth 2 -maxdepth 2 -name "*.json" 2>/dev/null); do \
id=$$(jq -r '.id // empty' "$$f" 2>/dev/null); \
if [ -n "$$id" ] && [ "$$id" != "null" ]; then \
sensor_name=$${id#hw-sensor-}; \
tag="sensor/$$sensor_name/v$(CLEAN_VERSION)"; \
echo " Creating tag $$tag..."; \
git tag "$$tag" 2>/dev/null || echo " ⚠️ Tag $$tag already exists, skipping."; \
fi; \
done
@echo ""
@echo "✅ All sensor tags created locally."
@echo "🚀 Run 'git push origin --tags' to push them to the server and trigger the CI pipelines."