From 19dc2b628da084b5d03c1d5ba856e2d21c60f4bc Mon Sep 17 00:00:00 2001 From: shanmukhkalasamudram Date: Thu, 19 Mar 2026 12:32:53 -0400 Subject: [PATCH] feat: add bfo-diff, stamp-version, build-ccom targets bfo-diff: fetches upstream BFO, diffs vs local, reports line counts stamp-version: updates owl:versionIRI and owl:versionInfo across all 12 ttl files build-ccom: ROBOT merge of 11 modules + BFO, then annotate with correct CCOM header All three targets require VERSION= and exit with a clear error if omitted. Full release pipeline: make all VERSION=2.1 DATE=YYYY-MM-DD Also: trim trailing whitespace in manage_release.yml (no logic changes) --- .github/workflows/manage_release.yml | 7 +-- Makefile | 86 +++++++++++++++++++++++++++- 2 files changed, 88 insertions(+), 5 deletions(-) diff --git a/.github/workflows/manage_release.yml b/.github/workflows/manage_release.yml index 3a466949..011ccd7f 100644 --- a/.github/workflows/manage_release.yml +++ b/.github/workflows/manage_release.yml @@ -2,11 +2,10 @@ name: Build, Test, Draft Release on: push: - branches: - - develop - - feature/* + branches: + - develop pull_request: - branches: + branches: - master permissions: diff --git a/Makefile b/Makefile index de2b8e28..da14031c 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,7 @@ REQUIRED_DIRS = $(config.LIBRARY_DIR) $(config.SOURCE_DIR) $(config.QUERIES_DIR) # ---------------------------------------- #### Targets / main "goals" of this Makefile .PHONY: all -all: setup reason-individual test-individual build-combined reason-combined test-combined +all: setup bfo-diff stamp-version reason-individual test-individual build-combined reason-combined test-combined build-ccom # Setup target for creating necessary directories .PHONY: setup @@ -169,3 +169,87 @@ clean: @[ "${config.REPORTS_DIR}" ] || ( echo ">> config.REPORTS_DIR is not set"; exit 1 ) rm -rf $(config.REPORTS_DIR) rm -rf $(combined-file) + +BFO_LOCAL := src/cco-imports/bfo-core.ttl +BFO_UPSTREAM_URL := http://purl.obolibrary.org/obo/bfo/2020/bfo-core.ttl +BFO_UPSTREAM_TMP := $(config.TEMP_DIR)/bfo-upstream-latest.ttl +BFO_DIFF_OUT := $(config.TEMP_DIR)/bfo-upstream-diff.txt + +.PHONY: bfo-diff +bfo-diff: | $(config.TEMP_DIR) + @echo "Fetching BFO upstream from $(BFO_UPSTREAM_URL)..." + curl -sSL -o $(BFO_UPSTREAM_TMP) $(BFO_UPSTREAM_URL) + @echo "Diffing local $(BFO_LOCAL) against upstream..." + @if diff -u $(BFO_LOCAL) $(BFO_UPSTREAM_TMP) > $(BFO_DIFF_OUT) 2>&1; then \ + echo "BFO DIFF: No changes — local copy is in sync with upstream."; \ + else \ + echo "BFO DIFF: Changes detected! Review $(BFO_DIFF_OUT) before release."; \ + echo "--- Summary (added/removed lines) ---"; \ + echo " Lines added : $$(grep -c '^+[^+]' $(BFO_DIFF_OUT) || echo 0)"; \ + echo " Lines removed: $$(grep -c '^-[^-]' $(BFO_DIFF_OUT) || echo 0)"; \ + fi + @echo "Full diff written to $(BFO_DIFF_OUT)" + +# --------------------------------------------------------------------------- +# T11 — stamp-version: Update owl:versionIRI and owl:versionInfo on all modules +# --------------------------------------------------------------------------- + +VERSION ?= +DATE ?= $(TODAY) + +.PHONY: stamp-version +stamp-version: + @if [ -z '$(VERSION)' ]; then \ + echo 'ERROR: VERSION is required. Usage: make stamp-version VERSION=2.1 [DATE=YYYY-MM-DD]'; \ + exit 1; \ + fi + @echo "Stamping v$(VERSION) ($(DATE)) on all module files..." + @for f in $(DEV_FILES); do \ + echo " $$f"; \ + sed -i '' \ + -e 's|