Skip to content

Commit d683778

Browse files
committed
github: use go version from go.mod file
1 parent 6576819 commit d683778

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

.github/workflows/builds.yml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ on:
1414
push:
1515
pull_request:
1616

17-
# set go version for all steps
18-
env:
19-
GOVERSION: 1.23.x
20-
2117
jobs:
2218
get-version:
2319
runs-on: ubuntu-latest
@@ -49,7 +45,7 @@ jobs:
4945
- uses: actions/checkout@v4
5046
- uses: actions/setup-go@v5
5147
with:
52-
go-version: ${{ env.GOVERSION }}
48+
go-version-file: './go.mod'
5349
- run: make citest
5450

5551

@@ -59,9 +55,8 @@ jobs:
5955
- uses: actions/checkout@v4
6056
- uses: actions/setup-go@v5
6157
with:
62-
go-version: ${{ env.GOVERSION }}
58+
go-version-file: './go.mod'
6359
- run: |
64-
echo "Testing with ${{ env.GOVERSION }}"
6560
go work init
6661
go work use .
6762
$Env:GOWORK = "off"
@@ -75,7 +70,7 @@ jobs:
7570
- uses: actions/checkout@v4
7671
- uses: actions/setup-go@v5
7772
with:
78-
go-version: ${{ env.GOVERSION }}
73+
go-version-file: './go.mod'
7974
- run: make test
8075

8176
test-bsd:
@@ -116,7 +111,7 @@ jobs:
116111
fetch-depth: 0
117112
- uses: actions/setup-go@v5
118113
with:
119-
go-version: ${{ env.GOVERSION }}
114+
go-version-file: './go.mod'
120115
- run: |
121116
echo "Building ${{ env.BIN }}"
122117
GOOS=${{ matrix.go-os }} GOARCH=${{ matrix.go-arch }} make build
@@ -143,7 +138,7 @@ jobs:
143138
fetch-depth: 0
144139
- uses: actions/setup-go@v5
145140
with:
146-
go-version: ${{ env.GOVERSION }}
141+
go-version-file: './go.mod'
147142
- run: |
148143
echo "Building ${{ env.BIN }}"
149144
GOOS=${{ matrix.go-os }} GOARCH=${{ matrix.go-arch }} make build
@@ -170,7 +165,7 @@ jobs:
170165
fetch-depth: 0
171166
- uses: actions/setup-go@v5
172167
with:
173-
go-version: ${{ env.GOVERSION }}
168+
go-version-file: './go.mod'
174169
- run: |
175170
echo "Building ${{ env.BIN }}.exe"
176171
rm -rf winres rsrc_windows_*
@@ -245,7 +240,7 @@ jobs:
245240
- uses: actions/checkout@v4
246241
- uses: actions/setup-go@v5
247242
with:
248-
go-version: ${{ env.GOVERSION }}
243+
go-version-file: './go.mod'
249244
- run: sudo apt-get update
250245
- run: sudo apt-get install help2man tofrodos
251246
- run: |
@@ -266,7 +261,7 @@ jobs:
266261
- uses: actions/checkout@v4
267262
- uses: actions/setup-go@v5
268263
with:
269-
go-version: ${{ env.GOVERSION }}
264+
go-version-file: './go.mod'
270265
- run: sudo apt-get update
271266
- run: sudo apt-get install help2man tofrodos
272267
- run: |
@@ -360,7 +355,7 @@ jobs:
360355
- uses: actions/checkout@v4
361356
- uses: actions/setup-go@v5
362357
with:
363-
go-version: ${{ env.GOVERSION }}
358+
go-version-file: './go.mod'
364359
- uses: actions/download-artifact@v4
365360
with:
366361
name: "${{ env.BIN }}"
@@ -397,7 +392,7 @@ jobs:
397392
- uses: actions/checkout@v4
398393
- uses: actions/setup-go@v5
399394
with:
400-
go-version: ${{ env.GOVERSION }}
395+
go-version-file: './go.mod'
401396
- uses: actions/download-artifact@v4
402397
with:
403398
name: "${{ env.BIN }}"
@@ -431,7 +426,7 @@ jobs:
431426
- uses: actions/checkout@v4
432427
- uses: actions/setup-go@v5
433428
with:
434-
go-version: ${{ env.GOVERSION }}
429+
go-version-file: './go.mod'
435430
- uses: actions/download-artifact@v4
436431
with:
437432
name: "${{ env.BIN }}"
@@ -484,7 +479,7 @@ jobs:
484479
- uses: actions/checkout@v4
485480
- uses: actions/setup-go@v5
486481
with:
487-
go-version: ${{ env.GOVERSION }}
482+
go-version-file: './go.mod'
488483
- uses: actions/download-artifact@v4
489484
with:
490485
name: "${{ env.BIN }}.deb"
@@ -508,7 +503,7 @@ jobs:
508503
- uses: actions/checkout@v4
509504
- uses: actions/setup-go@v5
510505
with:
511-
go-version: ${{ env.GOVERSION }}
506+
go-version-file: './go.mod'
512507
- uses: actions/download-artifact@v4
513508
with:
514509
name: "${{ env.BIN }}.pkg"
@@ -532,7 +527,7 @@ jobs:
532527
- uses: actions/checkout@v4
533528
- uses: actions/setup-go@v5
534529
with:
535-
go-version: ${{ env.GOVERSION }}
530+
go-version-file: './go.mod'
536531
- uses: actions/download-artifact@v4
537532
with:
538533
name: "windist"

buildtools/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module tools
22

3-
go 1.23.0
3+
go 1.23
44

55
require (
66
github.com/daixiang0/gci v0.12.3

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/consol-monitoring/snclient
22

3-
go 1.23.6
3+
go 1.23
44

55
require (
66
github.com/beevik/ntp v1.4.3

0 commit comments

Comments
 (0)