Deps: bump Go to 1.21.3 (#2450)

* build: override go version to 1.21.3

* build: re-enable cachix

* ci: set $USER if not set
This commit is contained in:
3u13r 2023-10-12 16:11:02 +02:00 committed by GitHub
parent e80e6076b4
commit 9e1a0c06bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 44 additions and 13 deletions

View File

@ -65,10 +65,20 @@ runs:
if: steps.check_inputs.outputs.nixPreinstalled == 'false'
uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac # v22
# - uses: cachix/cachix-action@6a9a34cdd93d0ae4b4b59fd678660efb08109f2f # v12
# with:
# name: katexochen
# extraPullNames: nix-community
- name: Set $USER if not set
shell: bash
run: |
echo "::group::Set \$USER if not set"
if [[ -z "$USER" ]]; then
echo "USER=$(id -un)" | tee -a "$GITHUB_ENV"
fi
echo "::endgroup::"
- uses: cachix/cachix-action@6a9a34cdd93d0ae4b4b59fd678660efb08109f2f # v12
with:
name: katexochen
extraPullNames: nix-community
- name: Install Bazelisk
if: steps.check_inputs.outputs.bazelPreinstalled == 'false' && steps.check_inputs.outputs.nixOS == 'false'

View File

@ -31,7 +31,7 @@ jobs:
- name: Setup Go environment
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: "1.21.1"
go-version: "1.21.3"
cache: false
- name: Install Crane

View File

@ -69,7 +69,7 @@ jobs:
- name: Setup Go environment
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: "1.21.1"
go-version: "1.21.3"
cache: false
- name: Determine version

View File

@ -40,7 +40,7 @@ jobs:
if: matrix.language == 'go'
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: "1.21.1"
go-version: "1.21.3"
cache: false
- name: Initialize CodeQL

View File

@ -219,7 +219,7 @@ jobs:
- name: Setup Go environment
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: "1.21.1"
go-version: "1.21.3"
cache: true
- name: Build generateMeasurements tool

View File

@ -32,7 +32,7 @@ jobs:
- name: Setup Go environment
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: "1.21.1"
go-version: "1.21.3"
cache: true
- name: Install Dependencies

View File

@ -28,7 +28,7 @@ jobs:
- name: Setup Go environment
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: "1.21.1"
go-version: "1.21.3"
cache: true
- name: Run code generation

View File

@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y \
git
# Install Go
ARG GO_VER=1.21.1
ARG GO_VER=1.21.3
RUN wget -q https://go.dev/dl/go${GO_VER}.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go${GO_VER}.linux-amd64.tar.gz && \
rm go${GO_VER}.linux-amd64.tar.gz

View File

@ -98,7 +98,7 @@ go_rules_dependencies()
load("@io_tweag_rules_nixpkgs//nixpkgs:toolchains/go.bzl", "nixpkgs_go_configure")
nixpkgs_go_configure(
attribute_path = "go_1_21",
nix_file = "//bazel/go:go.nix",
repository = "@nixpkgs",
)

21
bazel/go/go.nix Normal file
View File

@ -0,0 +1,21 @@
let
pkgs = import <nixpkgs> { };
goAttr = pkgs.go_1_21.overrideAttrs (_: rec {
version = "1.21.3";
src = pkgs.fetchurl {
url = "https://go.dev/dl/go${version}.src.tar.gz";
hash = "sha256-GG8rb4yLcE5paCGwmrIEGlwe4T3LwxVqE63PdZMe5Ig=";
};
});
in
pkgs.buildEnv
{
name = "bazel-go-toolchain";
paths = [ goAttr ];
postBuild = ''
touch $out/ROOT
ln -s $out/share/go/{api,doc,lib,misc,pkg,src,go.env} $out/
'';
} // {
version = goAttr.version;
}

View File

@ -1,6 +1,6 @@
go 1.21
toolchain go1.21.1
toolchain go1.21.3
use (
.