Skip to content

Commit

Permalink
bump golangci-lint / zeitgeist / cosign
Browse files Browse the repository at this point in the history
Signed-off-by: cpanato <ctadeu@gmail.com>
  • Loading branch information
cpanato committed May 8, 2024
1 parent ad24a9c commit 5fb976c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dependencies.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies:
# golangci/golangci-lint
- name: "golangci-lint"
version: 1.57.1
version: 1.58.0
refPaths:
- path: mage/golangci-lint.go
match: defaultGolangCILintVersion\s+=\s+"v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?"
Expand All @@ -15,7 +15,7 @@ dependencies:

# cosign
- name: "cosign"
version: 2.2.3
version: 2.2.4
refPaths:
- path: mage/cosign.go
match: defaultCosignVersion\s+=\s+"v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?"
Expand All @@ -29,7 +29,7 @@ dependencies:

# sigs.k8s.io/zeitgeist
- name: "zeitgeist"
version: 0.4.4
version: 0.5.3
refPaths:
- path: mage/dependency.go
match: defaultZeitgeistVersion\s+=\s+"v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?"
2 changes: 1 addition & 1 deletion mage/cosign.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/uwu-tools/magex/pkg/downloads"
)

const defaultCosignVersion = "v2.2.3"
const defaultCosignVersion = "v2.2.4"

// EnsureCosign makes sure that the specified cosign version is available
func EnsureCosign(version string) error {
Expand Down
32 changes: 31 additions & 1 deletion mage/dependency.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ import (

const (
// zeitgeist
defaultZeitgeistVersion = "v0.4.4"
defaultZeitgeistVersion = "v0.5.3"
zeitgeistCmd = "zeitgeist"
zeitgeistModule = "sigs.k8s.io/zeitgeist"
zeitgeistRemoteModule = "sigs.k8s.io/zeitgeist/remote/zeitgeist"
)

// Ensure zeitgeist is installed and on the PATH.
Expand Down Expand Up @@ -61,6 +62,35 @@ func EnsureZeitgeist(version string) error {
return nil
}

// Ensure zeitgeist remote is installed and on the PATH.
func EnsureZeitgeistRemote(version string) error {
if version == "" {
log.Printf(
"A zeitgeist remote version to install was not specified. Using default version: %s",
defaultZeitgeistVersion,
)

version = defaultZeitgeistVersion
}

if _, err := semver.ParseTolerant(version); err != nil {
return fmt.Errorf(
"%s was not SemVer-compliant, cannot continue: %w",
version, err,
)
}

if err := pkg.EnsurePackageWith(pkg.EnsurePackageOptions{
Name: zeitgeistRemoteModule,
DefaultVersion: version,
VersionCommand: "version",
}); err != nil {
return fmt.Errorf("ensuring package: %w", err)
}

return nil
}

// VerifyDeps runs zeitgeist to verify dependency versions
func VerifyDeps(version, basePath, configPath string, localOnly bool) error {
if err := EnsureZeitgeist(version); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion mage/golangci-lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (

const (
// golangci-lint
defaultGolangCILintVersion = "v1.57.1"
defaultGolangCILintVersion = "v1.58.0"
golangciCmd = "golangci-lint"
golangciConfig = ".golangci.yml"
golangciURLBase = "https://raw.githubusercontent.com/golangci/golangci-lint"
Expand Down

0 comments on commit 5fb976c

Please sign in to comment.