From 64eb82170fdcc50396194271be358bf9c9d43049 Mon Sep 17 00:00:00 2001 From: Ryan Schumacher Date: Thu, 22 Aug 2024 11:06:06 -0500 Subject: [PATCH] fix: make file not building correctly (#307) Co-authored-by: Jake Van Vorhis <83739412+jakedoublev@users.noreply.github.com> --- .github/workflows/release.yaml | 10 ++-------- Makefile | 22 +++++++++------------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f573042b..d0d2d8ca 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -51,22 +51,16 @@ jobs: # git push origin v${{ steps.release.outputs.major }} # git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} - - name: Build + - name: Build, compress, and draft checksums if: ${{ steps.release.outputs.release_created }} env: SEM_VER: ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} COMMIT_SHA: ${{ steps.release.outputs.sha }} run: make build - - name: Compress the builds and generate checksums - if: ${{ steps.release.outputs.release_created }} - env: - SEM_VER: ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} - run: make zip-builds - - name: Upload Release Artifact if: ${{ steps.release.outputs.release_created }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh release upload ${{ steps.release.outputs.tag_name }} ./output/**/* + run: gh release upload ${{ steps.release.outputs.tag_name }} ./output/* diff --git a/Makefile b/Makefile index e5feefcd..2c864e86 100644 --- a/Makefile +++ b/Makefile @@ -38,32 +38,28 @@ OUTPUT_DIR=output # Build commands for each platform PLATFORMS := darwin-amd64 darwin-arm64 linux-amd64 linux-arm linux-arm64 windows-amd64-.exe windows-arm-.exe windows-arm64-.exe -build: clean $(addprefix build-,$(PLATFORMS)) +build: test clean $(addprefix build-,$(PLATFORMS)) zip-builds verify-checksums build-%: GOOS=$(word 1,$(subst -, ,$*)) GOARCH=$(word 2,$(subst -, ,$*)) go build $(GO_BUILD_FLAGS) -o $(GO_BUILD_PREFIX)-$(word 1,$(subst -, ,$*))-$(word 2,$(subst -, ,$*))$(word 3,$(subst -, ,$*)) +zip-builds: + ./.github/scripts/zip-builds.sh $(BINARY_NAME)-$(CURR_VERSION) $(TARGET_DIR) $(OUTPUT_DIR) + +verify-checksums: + ./.github/scripts/verify-checksums.sh $(OUTPUT_DIR) $(BINARY_NAME)-$(CURR_VERSION)_checksums.txt + # Target for running the project (adjust as necessary for your project) .PHONY: run -run: build +run: go run . # Target for testing the project .PHONY: test -test: build +test: go test -v ./... # Target for cleaning up the target directory .PHONY: clean clean: rm -rf $(TARGET_DIR) - -# Script for zipping up the compiled binaries -.PHONY: zip-builds -zip-builds: - ./.github/scripts/zip-builds.sh $(BINARY_NAME)-$(CURR_VERSION) $(TARGET_DIR) $(OUTPUT_DIR) - -# Script for verifying the checksums -.PHONY: verify-checksums -verify-checksums: - .github/scripts/verify-checksums.sh $(OUTPUT_DIR) $(BINARY_NAME)-$(CURR_VERSION)_checksums.txt \ No newline at end of file