append vendor.tgz to each release (#2288)
This commit is contained in:
parent
f7409d47be
commit
4c4b545e9b
8 changed files with 22 additions and 33 deletions
|
@ -44,11 +44,11 @@ jobs:
|
||||||
${{ runner.os }}-${{ matrix.go-version }}-go-
|
${{ runner.os }}-${{ matrix.go-version }}-go-
|
||||||
|
|
||||||
- name: Build the binaries
|
- name: Build the binaries
|
||||||
run: make release
|
run: make vendor release
|
||||||
|
|
||||||
- name: Upload to release
|
- name: Upload to release
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
tag_name="${GITHUB_REF##*/}"
|
tag_name="${GITHUB_REF##*/}"
|
||||||
hub release edit -a crowdsec-release.tgz -m "" "$tag_name"
|
hub release edit -a crowdsec-release.tgz -a vendor.tgz -m "" "$tag_name"
|
||||||
|
|
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -30,8 +30,10 @@ test/coverage/*
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
|
|
||||||
# Dependency directories (remove the comment below to include it)
|
# Dependencies are not vendored by default, but a tarball is created by "make vendor"
|
||||||
# vendor/
|
# and provided in the release. Used by freebsd, gentoo, etc.
|
||||||
|
vendor/
|
||||||
|
vendor.tgz
|
||||||
|
|
||||||
# crowdsec binaries
|
# crowdsec binaries
|
||||||
cmd/crowdsec-cli/cscli
|
cmd/crowdsec-cli/cscli
|
||||||
|
|
20
Makefile
20
Makefile
|
@ -137,13 +137,25 @@ localstack:
|
||||||
localstack-stop:
|
localstack-stop:
|
||||||
docker-compose -f test/localstack/docker-compose.yml down
|
docker-compose -f test/localstack/docker-compose.yml down
|
||||||
|
|
||||||
|
# list of plugins that contain go.mod
|
||||||
|
PLUGIN_VENDOR = $(foreach plugin,$(PLUGINS),$(shell if [ -f $(PLUGINS_DIR)/$(plugin)/go.mod ]; then echo $(PLUGINS_DIR)/$(plugin); fi))
|
||||||
|
|
||||||
.PHONY: vendor
|
.PHONY: vendor
|
||||||
vendor:
|
vendor:
|
||||||
@echo "Vendoring dependencies"
|
$(foreach plugin_dir,$(PLUGIN_VENDOR), \
|
||||||
@$(GOCMD) mod vendor
|
cd $(plugin_dir) >/dev/null && \
|
||||||
@$(foreach plugin,$(PLUGINS), \
|
$(GOCMD) mod vendor && \
|
||||||
$(MAKE) -C $(PLUGINS_DIR)/$(plugin) vendor $(MAKE_FLAGS); \
|
cd - >/dev/null; \
|
||||||
)
|
)
|
||||||
|
$(GOCMD) mod vendor
|
||||||
|
tar -czf vendor.tgz vendor $(foreach plugin_dir,$(PLUGIN_VENDOR),$(plugin_dir)/vendor)
|
||||||
|
|
||||||
|
.PHONY: vendor-remove
|
||||||
|
vendor-remove:
|
||||||
|
$(foreach plugin_dir,$(PLUGIN_VENDOR), \
|
||||||
|
$(RM) $(plugin_dir)/vendor; \
|
||||||
|
)
|
||||||
|
$(RM) vendor vendor.tgz
|
||||||
|
|
||||||
.PHONY: package
|
.PHONY: package
|
||||||
package:
|
package:
|
||||||
|
|
|
@ -16,8 +16,3 @@ build: clean
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@$(RM) $(BINARY_NAME) $(WIN_IGNORE_ERR)
|
@$(RM) $(BINARY_NAME) $(WIN_IGNORE_ERR)
|
||||||
|
|
||||||
.PHONY: vendor
|
|
||||||
vendor:
|
|
||||||
@echo "vendoring $(PLUGIN) plugin..."
|
|
||||||
@$(GOCMD) mod vendor
|
|
||||||
|
|
|
@ -16,8 +16,3 @@ build: clean
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@$(RM) $(BINARY_NAME) $(WIN_IGNORE_ERR)
|
@$(RM) $(BINARY_NAME) $(WIN_IGNORE_ERR)
|
||||||
|
|
||||||
.PHONY: vendor
|
|
||||||
vendor:
|
|
||||||
@echo "vendoring $(PLUGIN) plugin..."
|
|
||||||
@$(GOCMD) mod vendor
|
|
||||||
|
|
|
@ -16,8 +16,3 @@ build: clean
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@$(RM) $(BINARY_NAME) $(WIN_IGNORE_ERR)
|
@$(RM) $(BINARY_NAME) $(WIN_IGNORE_ERR)
|
||||||
|
|
||||||
.PHONY: vendor
|
|
||||||
vendor:
|
|
||||||
@echo "vendoring $(PLUGIN) plugin..."
|
|
||||||
@$(GOCMD) mod vendor
|
|
||||||
|
|
|
@ -16,8 +16,3 @@ build: clean
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@$(RM) $(BINARY_NAME) $(WIN_IGNORE_ERR)
|
@$(RM) $(BINARY_NAME) $(WIN_IGNORE_ERR)
|
||||||
|
|
||||||
.PHONY: vendor
|
|
||||||
vendor:
|
|
||||||
@echo "vendoring $(PLUGIN) plugin..."
|
|
||||||
@$(GOCMD) mod vendor
|
|
||||||
|
|
|
@ -16,8 +16,3 @@ build: clean
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@$(RM) $(BINARY_NAME) $(WIN_IGNORE_ERR)
|
@$(RM) $(BINARY_NAME) $(WIN_IGNORE_ERR)
|
||||||
|
|
||||||
.PHONY: vendor
|
|
||||||
vendor:
|
|
||||||
@echo "vendoring $(PLUGIN) plugin..."
|
|
||||||
@$(GOCMD) mod vendor
|
|
||||||
|
|
Loading…
Reference in a new issue