Skip to content

Commit

Permalink
Update the gen_github_action_config to add latest to assets (#1260)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Vilgelm committed Jul 23, 2020
1 parent 63249d6 commit cb2f12e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ updates:
interval: weekly
reviewers:
- "golangci/team"
- package-ecosystem: gomod
directory: "/scripts/gen_github_action_config"
schedule:
interval: weekly
reviewers:
- "golangci/team"
4 changes: 4 additions & 0 deletions assets/github-action-config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"MinorVersionToConfig": {
"latest": {
"TargetVersion": "v1.29.0",
"AssetURL": "https://github.com/golangci/golangci-lint/releases/download/v1.29.0/golangci-lint-1.29.0-linux-amd64.tar.gz"
},
"v1.10": {
"Error": "golangci-lint version 'v1.10' isn't supported: we support only v1.14.0 and later versions"
},
Expand Down
5 changes: 2 additions & 3 deletions scripts/gen_github_action_config/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
module github.com/golangci/golangci-lint/scripts/gen_github_action_config

go 1.13
go 1.14

require (
github.com/shurcooL/githubv4 v0.0.0-20200414012201-bbc966b061dd
github.com/shurcooL/githubv4 v0.0.0-20200627185320-e003124d66e4
github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f // indirect
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
)
9 changes: 2 additions & 7 deletions scripts/gen_github_action_config/go.sum
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/shurcooL/githubv4 v0.0.0-20200414012201-bbc966b061dd h1:EwtC+kDj8s9OKiaStPZtTv3neldOyr98AXIxvmn3Gss=
github.com/shurcooL/githubv4 v0.0.0-20200414012201-bbc966b061dd/go.mod h1:hAF0iLZy4td2EX+/8Tw+4nodhlMrwN3HupfaXj3zkGo=
github.com/shurcooL/githubv4 v0.0.0-20200627185320-e003124d66e4 h1:cjmR6xY0f89IwBYMSwUrkFs4/1+KKw30Df3SqT7nZ6Q=
github.com/shurcooL/githubv4 v0.0.0-20200627185320-e003124d66e4/go.mod h1:hAF0iLZy4td2EX+/8Tw+4nodhlMrwN3HupfaXj3zkGo=
github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f h1:tygelZueB1EtXkPI6mQ4o9DQ0+FKW41hTbunoXZCTqk=
github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f/go.mod h1:AuYgA5Kyo4c7HfUmvRGs/6rGlMMV/6B1bVnB9JxJEEg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f h1:QBjCr1Fz5kw158VqdE9JfI9cJnl/ymnJWAdMuinqL7Y=
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
8 changes: 8 additions & 0 deletions scripts/gen_github_action_config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ func buildConfig(releases []release) (*actionConfig, error) {
minorVersionToConfig := map[string]versionConfig{}
minAllowedVersion := version{major: 1, minor: 14, patch: 0}

latestVersion := version{}
latestVersionConfig := versionConfig{}
for minorVersionedStr, maxPatchVersion := range maxPatchReleases {
if !maxPatchVersion.isAfterOrEq(&minAllowedVersion) {
minorVersionToConfig[minorVersionedStr] = versionConfig{
Expand All @@ -170,7 +172,13 @@ func buildConfig(releases []release) (*actionConfig, error) {
TargetVersion: maxPatchVersion.String(),
AssetURL: assetURL,
}
if maxPatchVersion.isAfterOrEq(&latestVersion) {
latestVersion = maxPatchVersion
latestVersionConfig.TargetVersion = maxPatchVersion.String()
latestVersionConfig.AssetURL = assetURL
}
}
minorVersionToConfig["latest"] = latestVersionConfig

return &actionConfig{MinorVersionToConfig: minorVersionToConfig}, nil
}
Expand Down

0 comments on commit cb2f12e

Please sign in to comment.