diff --git a/.gitignore b/.gitignore index faf396a..78333ea 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ krp loadtest main dist/ +src/config.yaml diff --git a/Makefile b/Makefile index 8e201fc..12a3799 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,10 @@ serve-docs: release-snapshot: make -C $(SRC_DIR) release-snapshot +.PHONY: release +release: + make -C $(SRC_DIR) release + .PHONY: clean clean: make -C $(SRC_DIR) clean diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100644 index 0000000..15a7918 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,12 @@ +# this is run in the github.com/techknowlogick/xgo container +# which allows us to easily do cross compilation + +# install docker +curl -sfL https://get.docker.com | sh +echo "ulimits: $(ulimit -Sn):$(ulimit -Hn)" +sed -i 's/ulimit -Hn/# ulimit -Hn/g' /etc/init.d/docker +service docker start + +# go to krp dir and run goreleaser +cd /tmp/krp/src +curl -sfL https://goreleaser.com/static/run | bash -s -- release diff --git a/src/.goreleaser.yaml b/src/.goreleaser.yaml index 6451ec9..8d54542 100644 --- a/src/.goreleaser.yaml +++ b/src/.goreleaser.yaml @@ -55,3 +55,6 @@ archives: format_overrides: - goos: windows format: zip + +changelog: + disable: true diff --git a/src/Makefile b/src/Makefile index d44afab..cb518d9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -28,6 +28,19 @@ release-snapshot: rm config.yaml sudo chown -R $(shell id -u):$(shell id -g) $(DIST_DIR) +.PHONY: release +release: + cp $(LOCAL_CONF) config.yaml + docker run \ + -v $(ROOT_DIR):/tmp/krp \ + -i \ + -e GITHUB_TOKEN=$(GITHUB_TOKEN) \ + --entrypoint '' \ + --privileged \ + techknowlogick/xgo:latest /bin/bash < $(SCRIPTS_DIR)/release.sh + rm config.yaml + sudo chown -R $(shell id -u):$(shell id -g) $(DIST_DIR) + .PHONY: clean clean: rm -rf $(BIN_DIR) || true