diff --git a/Makefile b/Makefile index 4f4718e..cf5723a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ .PHONY: build clean rebuild test typecheck .PHONY: bench bench-search bench-init bench-concurrent .PHONY: release-tag release-push +.PHONY: wf-release wf-publish wf-ci wf-list wf-watch # Build build: @@ -37,3 +38,41 @@ release-tag: release-push: git push --follow-tags + +# Workflows (requires gh cli + fzf) +# Trigger release PR workflow with interactive prompts +wf-release: + @TYPE=$$(echo -e "auto\npatch\nminor\nmajor" | fzf --prompt="Version type: " --height=6 --reverse); \ + if [ "$$TYPE" = "auto" ]; then \ + read -p "Custom version (leave empty for auto): " VERSION; \ + fi; \ + echo "→ Triggering release: type=$$TYPE version=$${VERSION:-auto}"; \ + gh workflow run release-pr.yml \ + -f version_type=$$TYPE \ + $${VERSION:+-f custom_version=$$VERSION}; \ + sleep 2; \ + $(MAKE) wf-watch W=release-pr.yml + +# Re-run failed publish workflow: make wf-publish [RUN=] +wf-publish: + $(if $(RUN),\ + gh run rerun $(RUN),\ + gh run rerun --failed -w release-publish.yml) + @sleep 2 + @$(MAKE) wf-watch W=release-publish.yml + +# Trigger CI workflow on current branch +wf-ci: + gh workflow run ci.yml --ref $(shell git branch --show-current) + @sleep 2 + @$(MAKE) wf-watch W=ci.yml + +# List recent workflow runs: make wf-list [W=] [N=10] +wf-list: + gh run list $(if $(W),-w $(W)) -L $(or $(N),10) + +# Watch latest workflow run: make wf-watch [W=] [RUN=] +wf-watch: + $(if $(RUN),\ + gh run watch $(RUN),\ + gh run watch $(shell gh run list $(if $(W),-w $(W)) -L 1 --json databaseId -q '.[0].databaseId'))