File tree Expand file tree Collapse file tree 4 files changed +31
-6
lines changed Expand file tree Collapse file tree 4 files changed +31
-6
lines changed Original file line number Diff line number Diff line change 2020 - uses : actions/checkout@v4
2121 - uses : actions/setup-go@v5
2222 with :
23- go-version : ' 1.23.0 '
23+ go-version : ' 1.23.1 '
2424 cache : false
2525 - name : golangci-lint
2626 uses : golangci/golangci-lint-action@v6
Original file line number Diff line number Diff line change @@ -21,17 +21,15 @@ jobs:
2121 - name : Set up Go
2222 uses : actions/setup-go@v5
2323 with :
24- go-version : ' 1.22.5 ' # Adjust the Go version as needed
24+ go-version : ' 1.23.1 ' # Adjust the Go version as needed
2525
2626 - name : Get Git Commit SHA
2727 id : git_info
2828 run : echo "::set-output name=sha::$(git rev-parse --short HEAD)"
2929
3030 - name : Build the project
3131 run : |
32- GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} \
33- go build -ldflags "-X main.version=${{ github.ref_name }} -X main.gitCommit=${{ steps.git_info.outputs.sha }}" \
34- -o tdiscuss-${{ matrix.goos }}-${{ matrix.goarch }} cmd/tdiscuss/main.go
32+ bazelisk build --stamp --workspace_status_command="${PWD}/status.sh" //:tdiscuss-${{ matrix.goos }}-${{ matrix.goarch }}
3533
3634 - name : Create GitHub Release
3735 id : create_release
5452 asset_path : ./tdiscuss-${{ matrix.goos }}-${{ matrix.goarch }}
5553 asset_name : tdiscuss-${{ matrix.goos }}-${{ matrix.goarch }}
5654 asset_content_type : application/octet-stream
57-
Original file line number Diff line number Diff line change @@ -72,3 +72,6 @@ clean-db:
7272
7373clean :
7474 $(BAZEL ) clean
75+
76+ check-go-versions :
77+ @bash check_go_versions.sh
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+
5+ set -x
6+
7+ # Everything should match what's in go.mod
8+ GV=$( grep " ^go" go.mod | awk ' {print $2}' | tr -d ' v' )
9+
10+ # There are only two places where version is defined so far but this should
11+ # catch most others as they're added as 'go-version'
12+ readarray -t versions < <( grep -h -r --include=" *.yml" --include=" *.yaml" go-version . | \
13+ awk ' {print $2}' | \
14+ tr -d " '" | \
15+ uniq)
16+
17+ if [[ " ${# versions[@]} " != 1 ]]; then
18+ printf " error: go-version mismatch in .github/workflows: "
19+ printf " have(%s), want(%s)\n" " ${versions} " " ${GV} " && exit 1
20+ fi
21+
22+ if [[ " ${GV} " != " ${versions[@]} " ]]; then
23+ printf " error: go-version mismatch in go.mod: "
24+ printf " have(%s), want(%s)\n" " $GV " " ${versions} " && exit 1
25+ fi
You can’t perform that action at this time.
0 commit comments