From 7582df61026bdc58421601964605252cb3d78c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Henrique=20Guard=C3=A3o=20Gandarez?= Date: Mon, 25 Nov 2024 15:51:42 -0300 Subject: [PATCH] Build for windows 7 --- .github/workflows/on_push.yml | 48 +++++++++++++++++++++++++++++++++++ Makefile | 9 +++++++ 2 files changed, 57 insertions(+) diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml index fae06673..a02769bc 100644 --- a/.github/workflows/on_push.yml +++ b/.github/workflows/on_push.yml @@ -219,6 +219,54 @@ jobs: name: IP Check run: make test-ip + build-windows-7: + name: Build Windows 7 with GO 1.20 + runs-on: ubuntu-latest + # needs: [version] + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Setup go + uses: actions/setup-go@v5 + with: + go-version: '^1.20.14' + check-latest: false + cache: false + - + name: Replace go version in go.mod + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "^go\\s[0-9\\.]+$" + replace: "go 1.20.14" + include: "go.mod" + - + name: Build binaries + env: + VERSION: 1.2.3 + shell: bash + # 2 is the number of virtual cpus for Linux. macOS is 3. + run: make -j2 build-windows-amd64-win7 + - + name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: binaries-windows + path: build/ + # - + # name: Remove tag if failure + # if: ${{ failure() }} + # uses: actions/github-script@v7 + # with: + # github-token: ${{ github.token }} + # script: | + # github.rest.git.deleteRef({ + # owner: context.repo.owner, + # repo: context.repo.repo, + # ref: "tags/${{ needs.version.outputs.semver_tag }}" + # }) + version: name: Version concurrency: tagging diff --git a/Makefile b/Makefile index 45ec5cd4..8097f7de 100644 --- a/Makefile +++ b/Makefile @@ -120,6 +120,9 @@ build-windows-386: build-windows-amd64: GOOS=windows GOARCH=amd64 $(MAKE) build-windows +build-windows-amd64-win7: + GOOS=windows GOARCH=amd64 $(MAKE) build-windows-7 + build-windows-arm64: GOOS=windows GOARCH=arm64 $(MAKE) build-windows @@ -135,6 +138,12 @@ build-windows: -ldflags "${LD_FLAGS} -X ${REPO}/pkg/version.OS=$(GOOS) -X ${REPO}/pkg/version.Arch=$(GOARCH)" \ -o ${BUILD_DIR}/$(BINARY_NAME)-$(GOOS)-$(GOARCH).exe +.PHONY: build-windows-7 +build-windows-7: + CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -v \ + -ldflags "${LD_FLAGS} -X ${REPO}/pkg/version.OS=$(GOOS) -X ${REPO}/pkg/version.Arch=$(GOARCH)" \ + -o ${BUILD_DIR}/$(BINARY_NAME)-$(GOOS)-$(GOARCH)-WIN7.exe + install: install-go-modules install-linter .PHONY: install-linter