Skip to content

Commit

Permalink
support full release
Browse files Browse the repository at this point in the history
  • Loading branch information
echo8 committed Nov 20, 2024
1 parent 4471475 commit 53fefc9
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ krp
loadtest
main
dist/
src/config.yaml
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions src/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ archives:
format_overrides:
- goos: windows
format: zip

changelog:
disable: true
13 changes: 13 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 53fefc9

Please sign in to comment.