Skip to content

Commit

Permalink
feat: add make recipe of generating workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
smorihira committed Sep 5, 2024
1 parent 05aea61 commit d456b77
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ license:
dockerfile:
$(call gen-dockerfile,$(ROOTDIR),$(MAINTAINER))

.PHONY: workflow
## generate workflows
workflow:
$(call gen-workflow,$(ROOTDIR),$(MAINTAINER))

.PHONY: init
## initialize development environment
init: \
Expand Down
17 changes: 17 additions & 0 deletions Makefile.d/functions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,23 @@ define gen-dockerfile
rm -rf $$BIN_PATH
endef

define gen-workflow
BIN_PATH="$(TEMP_DIR)/vald-actions-gen"; \
rm -rf $$BIN_PATH; \
MAINTAINER=$2 \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
go build -modcacherw \
-mod=readonly \
-a \
-tags "osusergo netgo static_build" \
-trimpath \
-o $$BIN_PATH $(ROOTDIR)/hack/actions/gen/main.go; \
$$BIN_PATH $1; \
rm -rf $$BIN_PATH
endef

define gen-vald-helm-schema
BIN_PATH="$(TEMP_DIR)/vald-helm-schema-gen"; \
rm -rf $$BIN_PATH; \
Expand Down

0 comments on commit d456b77

Please sign in to comment.