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 19, 2024
1 parent f77369f commit 34c45cd
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,60 @@ 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
-
run: go version
-
name: Replace go version in go.mod
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "(?m)^go\\s[0-9\\.]+$"
replace: "go 1.20.14"
include: "go.mod"
-
run: cat go.mod
-
run: go mod tidy
-
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-all-windows-7
-
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
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,23 @@ build-openbsd-arm:
build-openbsd-arm64:
GOOS=openbsd GOARCH=arm64 $(MAKE) build

# except windows 7
build-all-windows: build-windows-386 build-windows-amd64 build-windows-arm64

build-all-windows-7: build-windows-386-win7 build-windows-amd64-win7

build-windows-386:
GOOS=windows GOARCH=386 $(MAKE) build-windows

build-windows-386-win7:
GOOS=windows GOARCH=386 $(MAKE) build-windows-7

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 +144,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 34c45cd

Please sign in to comment.