File tree Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,57 @@ jobs:
219
219
name : IP Check
220
220
run : make test-ip
221
221
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
+ name : Replace go version in go.mod
239
+ uses : jacobtomlinson/gha-find-replace@v3
240
+ with :
241
+ find : " (?m)^go\\ s[0-9\\ .]+$"
242
+ replace : " go 1.20.14"
243
+ include : " go.mod"
244
+ -
245
+ name : Run tidy
246
+ run : go mod tidy
247
+ -
248
+ name : Build binaries
249
+ env :
250
+ VERSION : 1.2.3
251
+ shell : bash
252
+ # 2 is the number of virtual cpus for Linux. macOS is 3.
253
+ run : make -j2 build-all-windows-7
254
+ -
255
+ name : Upload artifacts
256
+ uses : actions/upload-artifact@v4
257
+ with :
258
+ name : binaries-windows
259
+ path : build/
260
+ # -
261
+ # name: Remove tag if failure
262
+ # if: ${{ failure() }}
263
+ # uses: actions/github-script@v7
264
+ # with:
265
+ # github-token: ${{ github.token }}
266
+ # script: |
267
+ # github.rest.git.deleteRef({
268
+ # owner: context.repo.owner,
269
+ # repo: context.repo.repo,
270
+ # ref: "tags/${{ needs.version.outputs.semver_tag }}"
271
+ # })
272
+
222
273
version :
223
274
name : Version
224
275
concurrency : tagging
Original file line number Diff line number Diff line change @@ -112,14 +112,23 @@ build-openbsd-arm:
112
112
build-openbsd-arm64 :
113
113
GOOS=openbsd GOARCH=arm64 $(MAKE ) build
114
114
115
+ # except windows 7
115
116
build-all-windows : build-windows-386 build-windows-amd64 build-windows-arm64
116
117
118
+ build-all-windows-7 : build-windows-386-win7 build-windows-amd64-win7
119
+
117
120
build-windows-386 :
118
121
GOOS=windows GOARCH=386 $(MAKE ) build-windows
119
122
123
+ build-windows-386-win7 :
124
+ GOOS=windows GOARCH=386 $(MAKE ) build-windows-7
125
+
120
126
build-windows-amd64 :
121
127
GOOS=windows GOARCH=amd64 $(MAKE ) build-windows
122
128
129
+ build-windows-amd64-win7 :
130
+ GOOS=windows GOARCH=amd64 $(MAKE ) build-windows-7
131
+
123
132
build-windows-arm64 :
124
133
GOOS=windows GOARCH=arm64 $(MAKE ) build-windows
125
134
@@ -135,6 +144,12 @@ build-windows:
135
144
-ldflags " ${LD_FLAGS} -X ${REPO} /pkg/version.OS=$( GOOS) -X ${REPO} /pkg/version.Arch=$( GOARCH) " \
136
145
-o ${BUILD_DIR} /$(BINARY_NAME ) -$(GOOS ) -$(GOARCH ) .exe
137
146
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
+
138
153
install : install-go-modules install-linter
139
154
140
155
.PHONY : install-linter
You can’t perform that action at this time.
0 commit comments