diff --git a/Makefile b/Makefile index 1fbab9c..2749ed3 100644 --- a/Makefile +++ b/Makefile @@ -128,40 +128,53 @@ jjnew: @echo "$(GREEN)✓ New commit created$(NC)" jjpush: - @echo "$(YELLOW)→ Pushing commit to repository...$(NC)" + @$(MAKE) jjpush-describe + @$(MAKE) jjpush-bump + @$(MAKE) jjpush-push + @$(MAKE) jjpush-tag + @echo "$(GREEN)✓ Release complete$(NC)" + +jjpush-describe: @echo "$(BLUE)→ Documenting current commit...$(NC)" @jj auto-describe + +jjpush-bump: @echo "$(BLUE)→ Creating new commit for version bump...$(NC)" @jj new - @previous_version=$$(cat version.txt); \ - $(MAKE) bump-version; \ - version=$$(cat version.txt); \ + @$(MAKE) bump-version + @echo "$(BLUE)→ Documenting version bump commit...$(NC)" + @jj auto-describe + +jjpush-push: + @echo "$(BLUE)→ Pushing commits...$(NC)" + @jj git push --change @ + +jjpush-tag: + @version=$$(cat version.txt); \ tag_name="Release_$$version"; \ - previous_tag="Release_$$previous_version"; \ - echo "$(BLUE)→ Documenting version bump commit...$(NC)"; \ - jj auto-describe; \ - echo "$(BLUE)→ Generating release notes from $$previous_tag to current commit...$(NC)"; \ + echo "$(BLUE)→ Generating release notes for $$tag_name...$(NC)"; \ + release_message="Release $$version"; \ if command -v orla >/dev/null 2>&1 && command -v jq >/dev/null 2>&1; then \ - release_json=$$(jj log -r "$$previous_tag::@" -T 'commit_id.short() ++ " " ++ description' | \ + previous_patch=$$(( $$(echo $$version | cut -d. -f3) - 1 )); \ + previous_tag="Release_$$(echo $$version | cut -d. -f1).$$(echo $$version | cut -d. -f2).$$previous_patch"; \ + raw_output=$$(jj log -r "$$previous_tag::@" -T 'commit_id.short() ++ " " ++ description' | \ ORLA_MAX_TOOL_CALLS=50 orla agent -m ollama:qwen3-coder-next:latest \ - "Summarize the following commits into a GitHub release note for version $$version. Ignore commits related to version bumps, .gitignore changes, or any internal housekeeping that is irrelevant to end users. Describe each user-facing change precisely without exposing code. Eliminate redundancy. Output strictly valid JSON with no surrounding text, using this exact schema: {\"title\": \"\", \"body\": \"\"}"); \ - release_json=$$(echo "$$release_json" | sed -n '/^{/,/^}/p'); \ - release_title=$$(echo "$$release_json" | jq -r '.title // empty') ; \ - release_body=$$(echo "$$release_json" | jq -r '.body // empty') ; \ - if [ -n "$$release_title" ] && [ -n "$$release_body" ]; then \ - release_message="$$release_title"$$'\n\n'"$$release_body"; \ - else \ - echo "$(YELLOW)⚠ JSON parsing failed, falling back to raw output$(NC)"; \ - release_message="Release $$version"$$'\n\n'"$$release_json"; \ + "Summarize the following commits into a GitHub release note for version $$version. Ignore commits related to version bumps, .gitignore changes, or any internal housekeeping that is irrelevant to end users. Describe each user-facing change precisely without exposing code. Eliminate redundancy. Output strictly valid JSON with no surrounding text, using this exact schema: {\"title\": \"\", \"body\": \"\"}" 2>/dev/null) || true; \ + if [ -n "$$raw_output" ]; then \ + sanitized=$$(echo "$$raw_output" | sed -n '/^{/,/^}/p' | tr -d '\000-\011\013-\014\016-\037'); \ + release_title=$$(echo "$$sanitized" | jq -r '.title // empty' 2>/dev/null) ; \ + release_body=$$(echo "$$sanitized" | jq -r '.body // empty' 2>/dev/null) ; \ + if [ -n "$$release_title" ] && [ -n "$$release_body" ]; then \ + release_message="$$release_title"$$'\n\n'"$$release_body"; \ + else \ + echo "$(YELLOW)⚠ JSON parsing failed, using default release message$(NC)"; \ + fi; \ fi; \ - else \ - release_message="Release $$version"; \ fi; \ - echo "$(BLUE)→ Pushing commits and creating tag $$tag_name...$(NC)"; \ - jj git push --change @; \ - git tag -a "$$tag_name" -m "$$release_message" 2>/dev/null || echo "Tag $$tag_name already exists"; \ - git push origin "$$tag_name" 2>/dev/null || echo "Tag already pushed" - @echo "$(GREEN)✓ Commits and tag pushed to repository$(NC)" + echo "$(BLUE)→ Creating tag $$tag_name...$(NC)"; \ + git tag -a "$$tag_name" -m "$$release_message" 2>/dev/null || echo "$(YELLOW)⚠ Tag $$tag_name already exists$(NC)"; \ + echo "$(BLUE)→ Pushing tag $$tag_name...$(NC)"; \ + git push origin "$$tag_name" 2>/dev/null || echo "$(YELLOW)⚠ Tag push failed or already pushed$(NC)" jjfetch: @echo "$(YELLOW)→ Pulling latest commits...$(NC)" @@ -169,5 +182,5 @@ jjfetch: @jj new master@origin @echo "$(GREEN)✓ Latest commits pulled$(NC)" -.PHONY: all obitools update-deps obitests githubtests jjnew jjpush jjfetch bump-version .FORCE +.PHONY: all obitools update-deps obitests githubtests jjnew jjpush jjpush-describe jjpush-bump jjpush-push jjpush-tag jjfetch bump-version .FORCE .FORCE: diff --git a/pkg/obioptions/version.go b/pkg/obioptions/version.go index f338b2f..65c836e 100644 --- a/pkg/obioptions/version.go +++ b/pkg/obioptions/version.go @@ -3,7 +3,7 @@ package obioptions // Version is automatically updated by the Makefile from version.txt // The patch number (third digit) is incremented on each push to the repository -var _Version = "Release 4.4.15" +var _Version = "Release 4.4.16" // Version returns the version of the obitools package. // diff --git a/version.txt b/version.txt index 9613784..9033f1b 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -4.4.15 +4.4.16