|
1 | 1 | .PHONY: build clean rebuild test typecheck |
2 | 2 | .PHONY: bench bench-search bench-init bench-concurrent |
3 | 3 | .PHONY: release-tag release-push |
| 4 | +.PHONY: wf-release wf-publish wf-ci wf-list wf-watch |
4 | 5 |
|
5 | 6 | # Build |
6 | 7 | build: |
@@ -37,3 +38,41 @@ release-tag: |
37 | 38 |
|
38 | 39 | release-push: |
39 | 40 | git push --follow-tags |
| 41 | + |
| 42 | +# Workflows (requires gh cli + fzf) |
| 43 | +# Trigger release PR workflow with interactive prompts |
| 44 | +wf-release: |
| 45 | + @TYPE=$$(echo -e "auto\npatch\nminor\nmajor" | fzf --prompt="Version type: " --height=6 --reverse); \ |
| 46 | + if [ "$$TYPE" = "auto" ]; then \ |
| 47 | + read -p "Custom version (leave empty for auto): " VERSION; \ |
| 48 | + fi; \ |
| 49 | + echo "→ Triggering release: type=$$TYPE version=$${VERSION:-auto}"; \ |
| 50 | + gh workflow run release-pr.yml \ |
| 51 | + -f version_type=$$TYPE \ |
| 52 | + $${VERSION:+-f custom_version=$$VERSION}; \ |
| 53 | + sleep 2; \ |
| 54 | + $(MAKE) wf-watch W=release-pr.yml |
| 55 | + |
| 56 | +# Re-run failed publish workflow: make wf-publish [RUN=<run-id>] |
| 57 | +wf-publish: |
| 58 | + $(if $(RUN),\ |
| 59 | + gh run rerun $(RUN),\ |
| 60 | + gh run rerun --failed -w release-publish.yml) |
| 61 | + @sleep 2 |
| 62 | + @$(MAKE) wf-watch W=release-publish.yml |
| 63 | + |
| 64 | +# Trigger CI workflow on current branch |
| 65 | +wf-ci: |
| 66 | + gh workflow run ci.yml --ref $(shell git branch --show-current) |
| 67 | + @sleep 2 |
| 68 | + @$(MAKE) wf-watch W=ci.yml |
| 69 | + |
| 70 | +# List recent workflow runs: make wf-list [W=<workflow>] [N=10] |
| 71 | +wf-list: |
| 72 | + gh run list $(if $(W),-w $(W)) -L $(or $(N),10) |
| 73 | + |
| 74 | +# Watch latest workflow run: make wf-watch [W=<workflow>] [RUN=<run-id>] |
| 75 | +wf-watch: |
| 76 | + $(if $(RUN),\ |
| 77 | + gh run watch $(RUN),\ |
| 78 | + gh run watch $(shell gh run list $(if $(W),-w $(W)) -L 1 --json databaseId -q '.[0].databaseId')) |
0 commit comments