From cf666bb394d56f5956547f2e36eb1d737c9505c8 Mon Sep 17 00:00:00 2001 From: wi1dcard Date: Sun, 25 May 2025 12:06:14 +0800 Subject: [PATCH 1/3] Fix cross compile. --- Makefile | 4 +--- example/echo-server/Makefile | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 487ba27..d74bec0 100644 --- a/Makefile +++ b/Makefile @@ -18,9 +18,7 @@ TAG = $(shell git describe --tags --abbrev=0 HEAD 2>/dev/null || true) BINPATH = bin/$(TARGET)_$(GOOS)_$(GOARCH)$(EXT) build_%: - export GOOS=$(GOOS) GOARCH=$(GOARCH) - - go build -o $(BINPATH) \ + GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(BINPATH) \ -ldflags "-X main.buildCommit=$(COMMIT) -X main.buildVersion=$(TAG)" \ -gcflags "./...=-m" \ -gcflags "./pkg/http2=" \ diff --git a/example/echo-server/Makefile b/example/echo-server/Makefile index d18a1c0..c7aa979 100644 --- a/example/echo-server/Makefile +++ b/example/echo-server/Makefile @@ -16,8 +16,6 @@ build_%_arm64: GOARCH = arm64 BINPATH = bin/$(TARGET)_$(GOOS)_$(GOARCH)$(EXT) build_%: - export GOOS=$(GOOS) GOARCH=$(GOARCH) - - go build -o $(BINPATH) . + GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(BINPATH) . chmod +x $(BINPATH) From 92322a902eb2996a2699c875d86f3f27d6559d81 Mon Sep 17 00:00:00 2001 From: wi1dcard Date: Sun, 25 May 2025 12:27:12 +0800 Subject: [PATCH 2/3] Add sha256sum to release artifacts. --- .github/workflows/release.yaml | 8 ++++++-- Makefile | 6 +++++- example/echo-server/Makefile | 6 +++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 91295a7..81fffd7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -23,10 +23,14 @@ jobs: go version go get - - run: make build + - run: | + make build + make sha256sum - working-directory: ./example/echo-server - run: make build + run: | + make build + make sha256sum - name: Create release env: diff --git a/Makefile b/Makefile index d74bec0..3ade0b2 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,8 @@ build_%_arm64: GOARCH = arm64 COMMIT = $(shell git rev-parse --short HEAD || true) TAG = $(shell git describe --tags --abbrev=0 HEAD 2>/dev/null || true) -BINPATH = bin/$(TARGET)_$(GOOS)_$(GOARCH)$(EXT) +BINDIR = bin +BINPATH = $(BINDIR)/$(TARGET)_$(GOOS)_$(GOARCH)$(EXT) build_%: GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(BINPATH) \ @@ -26,6 +27,9 @@ build_%: chmod +x $(BINPATH) +sha256sum: + cd $(BINDIR) && sha256sum $(TARGET)_* > $(TARGET).sha256sum + PKG_LIST = $(shell go list ./... | grep -v github.com/wi1dcard/fingerproxy/pkg/http2) test: @go test -v $(PKG_LIST) diff --git a/example/echo-server/Makefile b/example/echo-server/Makefile index c7aa979..5876ed7 100644 --- a/example/echo-server/Makefile +++ b/example/echo-server/Makefile @@ -13,9 +13,13 @@ build_%_amd64: GOARCH = amd64 build_%_arm: GOARCH = arm build_%_arm64: GOARCH = arm64 -BINPATH = bin/$(TARGET)_$(GOOS)_$(GOARCH)$(EXT) +BINDIR = bin +BINPATH = $(BINDIR)/$(TARGET)_$(GOOS)_$(GOARCH)$(EXT) build_%: GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(BINPATH) . chmod +x $(BINPATH) + +sha256sum: + cd $(BINDIR) && sha256sum $(TARGET)_* > $(TARGET).sha256sum From 2f359c4b422b8151e8fa3bd13952132598c948cd Mon Sep 17 00:00:00 2001 From: wi1dcard Date: Sun, 25 May 2025 12:28:19 +0800 Subject: [PATCH 3/3] Run sha256sum also on commits. --- .github/workflows/ci.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e9ced78..6751844 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,7 +41,10 @@ jobs: - run: | go version go get - - run: make build + + - run: | + make build + make sha256sum - name: Extract short commit SHA id: short-sha