Skip to content

Commit 2d60d2f

Browse files
authored
feat(make): add workflow targets with fzf interactive prompts (#6)
- wf-release: interactive version type selection via fzf - wf-publish: re-run failed publish workflow - wf-ci: trigger CI on current branch - wf-list: list recent workflow runs - wf-watch: watch workflow run progress Signed-off-by: assagman <[email protected]>
1 parent 314289f commit 2d60d2f

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.PHONY: build clean rebuild test typecheck
22
.PHONY: bench bench-search bench-init bench-concurrent
33
.PHONY: release-tag release-push
4+
.PHONY: wf-release wf-publish wf-ci wf-list wf-watch
45

56
# Build
67
build:
@@ -37,3 +38,41 @@ release-tag:
3738

3839
release-push:
3940
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

Comments
 (0)