Skip to content

Commit

Permalink
Build for windows 7
Browse files Browse the repository at this point in the history
  • Loading branch information
gandarez committed Dec 5, 2024
1 parent f77369f commit 73030ef
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 73030ef

Please sign in to comment.