File tree Expand file tree Collapse file tree 2 files changed +69
-0
lines changed Expand file tree Collapse file tree 2 files changed +69
-0
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,60 @@ jobs:
219219 name : IP Check
220220 run : make test-ip
221221
222+ build-windows-7 :
223+ name : Build Windows 7 with GO 1.20
224+ runs-on : ubuntu-latest
225+ # needs: [version]
226+ steps :
227+ -
228+ name : Checkout
229+ uses : actions/checkout@v4
230+ -
231+ name : Setup go
232+ uses : actions/setup-go@v5
233+ with :
234+ go-version : ' 1.20.14'
235+ check-latest : false
236+ cache : false
237+ -
238+ run : go version
239+ -
240+ name : Replace go version in go.mod
241+ uses : jacobtomlinson/gha-find-replace@v3
242+ with :
243+ find : " (?m)^go\\ s[0-9\\ .]+$"
244+ replace : " go 1.20.14"
245+ include : " go.mod"
246+ -
247+ run : cat go.mod
248+ -
249+ run : go mod tidy
250+ -
251+ name : Build binaries
252+ env :
253+ VERSION : 1.2.3
254+ shell : bash
255+ # 2 is the number of virtual cpus for Linux. macOS is 3.
256+ run : make -j2 build-all-windows-7
257+ -
258+ name : Upload artifacts
259+ uses : actions/upload-artifact@v4
260+ with :
261+ name : binaries-windows
262+ path : build/
263+ # -
264+ # name: Remove tag if failure
265+ # if: ${{ failure() }}
266+ # uses: actions/github-script@v7
267+ # with:
268+ # github-token: ${{ github.token }}
269+ # script: |
270+ # github.rest.git.deleteRef({
271+ # owner: context.repo.owner,
272+ # repo: context.repo.repo,
273+ # ref: "tags/${{ needs.version.outputs.semver_tag }}"
274+ # })
275+
222276 version :
223277 name : Version
224278 concurrency : tagging
Original file line number Diff line number Diff line change @@ -112,14 +112,23 @@ build-openbsd-arm:
112112build-openbsd-arm64 :
113113 GOOS=openbsd GOARCH=arm64 $(MAKE ) build
114114
115+ # except windows 7
115116build-all-windows : build-windows-386 build-windows-amd64 build-windows-arm64
116117
118+ build-all-windows-7 : build-windows-386-win7 build-windows-amd64-win7
119+
117120build-windows-386 :
118121 GOOS=windows GOARCH=386 $(MAKE ) build-windows
119122
123+ build-windows-386-win7 :
124+ GOOS=windows GOARCH=386 $(MAKE ) build-windows-7
125+
120126build-windows-amd64 :
121127 GOOS=windows GOARCH=amd64 $(MAKE ) build-windows
122128
129+ build-windows-amd64-win7 :
130+ GOOS=windows GOARCH=amd64 $(MAKE ) build-windows-7
131+
123132build-windows-arm64 :
124133 GOOS=windows GOARCH=arm64 $(MAKE ) build-windows
125134
@@ -135,6 +144,12 @@ build-windows:
135144 -ldflags " ${LD_FLAGS} -X ${REPO} /pkg/version.OS=$( GOOS) -X ${REPO} /pkg/version.Arch=$( GOARCH) " \
136145 -o ${BUILD_DIR} /$(BINARY_NAME ) -$(GOOS ) -$(GOARCH ) .exe
137146
147+ .PHONY : build-windows-7
148+ build-windows-7 :
149+ CGO_ENABLED=$(CGO_ENABLED ) GOOS=$(GOOS ) GOARCH=$(GOARCH ) $(GOBUILD ) -v \
150+ -ldflags " ${LD_FLAGS} -X ${REPO} /pkg/version.OS=$( GOOS) -X ${REPO} /pkg/version.Arch=$( GOARCH) " \
151+ -o ${BUILD_DIR} /$(BINARY_NAME ) -$(GOOS ) -$(GOARCH ) -win7.exe
152+
138153install : install-go-modules install-linter
139154
140155.PHONY : install-linter
You can’t perform that action at this time.
0 commit comments