diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 20d9ed8d..fac82c9e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ jobs: - name: Install Go uses: actions/setup-go@v2 with: - go-version: 1.18.x + go-version: 1.20.x - name: Check out repository code uses: actions/checkout@v2 - name: Install gotestsum diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index f8b82582..b6c71578 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -15,7 +15,7 @@ blocks: jobs: - name: Build cache CLI commands: - - sem-version go 1.18 + - sem-version go 1.20 - "export GOPATH=~/go" - "export PATH=/home/semaphore/go/bin:$PATH" - checkout @@ -32,7 +32,7 @@ blocks: - artifact push workflow bin/windows/cache.exe -d bin/windows/cache.exe - name: Build sem-context CLI commands: - - sem-version go 1.17 + - sem-version go 1.20 - "export GOPATH=~/go" - "export PATH=/home/semaphore/go/bin:$PATH" - checkout @@ -542,7 +542,7 @@ blocks: value: "on" prologue: commands: - - sem-version go 1.18 + - sem-version go 1.20 - checkout && cd cache-cli jobs: - name: Lint diff --git a/cache-cli/Dockerfile.dev b/cache-cli/Dockerfile.dev index a88cea16..6a56452d 100644 --- a/cache-cli/Dockerfile.dev +++ b/cache-cli/Dockerfile.dev @@ -1,4 +1,4 @@ -FROM golang:1.18 +FROM golang:1.20 RUN go install gotest.tools/gotestsum@latest RUN mkdir /root/.ssh diff --git a/cache-cli/go.mod b/cache-cli/go.mod index 4f7ee6fa..9294d5d1 100644 --- a/cache-cli/go.mod +++ b/cache-cli/go.mod @@ -1,6 +1,6 @@ module github.com/semaphoreci/toolbox/cache-cli -go 1.18 +go 1.20 require ( cloud.google.com/go/storage v1.30.1 diff --git a/cache-cli/pkg/archive/native_archiver.go b/cache-cli/pkg/archive/native_archiver.go index eb130a0c..38a778c4 100644 --- a/cache-cli/pkg/archive/native_archiver.go +++ b/cache-cli/pkg/archive/native_archiver.go @@ -207,7 +207,8 @@ func (a *NativeArchiver) Decompress(src string) (string, error) { } // #nosec - if _, err := io.Copy(outFile, tarReader); err != nil { + _, err = io.Copy(outFile, tarReader) + if err != nil { log.Errorf("Error writing to file '%s': %v", header.Name, err) hadError = true _ = outFile.Close() diff --git a/cache-cli/pkg/files/checksum.go b/cache-cli/pkg/files/checksum.go index 33b3cc3c..5409c662 100644 --- a/cache-cli/pkg/files/checksum.go +++ b/cache-cli/pkg/files/checksum.go @@ -7,8 +7,8 @@ import ( "os" ) -// #nosec func GenerateChecksum(filePath string) (string, error) { + // #nosec file, err := os.Open(filePath) if err != nil { return "", err @@ -16,6 +16,7 @@ func GenerateChecksum(filePath string) (string, error) { defer file.Close() + // #nosec hash := md5.New() if _, err := io.Copy(hash, file); err != nil { return "", err diff --git a/release/create.sh b/release/create.sh index 174b8e46..301a9d70 100755 --- a/release/create.sh +++ b/release/create.sh @@ -2,10 +2,10 @@ set -euo pipefail -ARTIFACT_CLI_VERSION="v0.6.2" +ARTIFACT_CLI_VERSION="v0.6.3" WHEN_CLI_VERSION="v1.0.5" -SPC_CLI_VERSION="v1.9.5" -TEST_RESULTS_CLI_VERSION="v0.6.8" +SPC_CLI_VERSION="v1.9.6" +TEST_RESULTS_CLI_VERSION="v0.6.9" ARTIFACT_CLI_URL="https://github.com/semaphoreci/artifact/releases/download/$ARTIFACT_CLI_VERSION" SPC_CLI_URL="https://github.com/semaphoreci/spc/releases/download/$SPC_CLI_VERSION" diff --git a/sem-context/Dockerfile.dev b/sem-context/Dockerfile.dev index c794c773..e32eb954 100644 --- a/sem-context/Dockerfile.dev +++ b/sem-context/Dockerfile.dev @@ -1,4 +1,4 @@ -FROM golang:1.17 +FROM golang:1.20 RUN go get gotest.tools/gotestsum diff --git a/sem-context/go.mod b/sem-context/go.mod index d7b86091..4d81222b 100644 --- a/sem-context/go.mod +++ b/sem-context/go.mod @@ -1,6 +1,6 @@ module github.com/semaphoreci/toolbox/sem-context -go 1.17 +go 1.20 require github.com/spf13/cobra v1.5.0