Skip to content

Commit

Permalink
chore: make release builds reproducible
Browse files Browse the repository at this point in the history
  • Loading branch information
mbreithecker committed May 6, 2024
1 parent 6e0aba8 commit 6bbc994
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ GO_VERSION := $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1,2)
# VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
VERSION := v1.5.0

BUILD_TIME := 202405060800.00 # format [[CC]YY]MMDDhhmm[.ss]

TEAM_ALLOCATION := 165000000000000
ifeq ($(ENV),kaon)
$(info 📑 Using Kaon environment...)
Expand Down Expand Up @@ -52,28 +54,24 @@ install: ensure_environment ensure_version
@echo "✅ Completed installation!"

release: ensure_environment ensure_version
@echo "🤖 Creating kyved releases..."
@echo "🤖 Creating kyved releases (using timestamp $(BUILD_TIME))..."
@rm -rf release
@mkdir -p release

@GOOS=darwin GOARCH=amd64 go build $(BUILD_FLAGS) ./cmd/kyved
@tar -czf release/kyved_$(ENV)_darwin_amd64.tar.gz kyved
@sha256sum release/kyved_$(ENV)_darwin_amd64.tar.gz >> release/release_$(ENV)_checksum

@GOOS=darwin GOARCH=arm64 go build $(BUILD_FLAGS) ./cmd/kyved
@tar -czf release/kyved_$(ENV)_darwin_arm64.tar.gz kyved
@sha256sum release/kyved_$(ENV)_darwin_arm64.tar.gz >> release/release_$(ENV)_checksum

@GOOS=linux GOARCH=amd64 go build $(BUILD_FLAGS) ./cmd/kyved
@tar -czf release/kyved_$(ENV)_linux_amd64.tar.gz kyved
@sha256sum release/kyved_$(ENV)_linux_amd64.tar.gz >> release/release_$(ENV)_checksum

@GOOS=linux GOARCH=arm64 go build $(BUILD_FLAGS) ./cmd/kyved
@tar -czf release/kyved_$(ENV)_linux_arm64.tar.gz kyved
@sha256sum release/kyved_$(ENV)_linux_arm64.tar.gz >> release/release_$(ENV)_checksum
@for b in darwin:amd64 darwin:arm64 linux:amd64 linux:arm64; do \
os=$$(echo $$b | cut -d':' -f1); \
arch=$$(echo $$b | cut -d':' -f2); \
echo "➡️ "$$os" "$$arch""; \
GOOS=$$os GOARCH=$$arch go build $(BUILD_FLAGS) ./cmd/kyved; \
touch -a -m -t $(BUILD_TIME) kyved; \
tar -cf release/kyved_$(ENV)_"$$os"_"$$arch".tar kyved; \
touch -a -m -t $(BUILD_TIME) release/kyved_$(ENV)_"$$os"_"$$arch".tar; \
gzip release/kyved_$(ENV)_"$$os"_"$$arch".tar; \
sha256sum release/kyved_$(ENV)_"$$os"_"$$arch".tar.gz >> release/release_$(ENV)_checksum; \
done

@rm kyved
@echo "✅ Completed release creation!"
@echo "✅ Completed release creation!"

###############################################################################
### Docker Build ###
Expand Down

0 comments on commit 6bbc994

Please sign in to comment.