Skip to content

Commit cb2f12e

Browse files
author
Sergey Vilgelm
authored
Update the gen_github_action_config to add latest to assets (#1260)
1 parent 63249d6 commit cb2f12e

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@ updates:
2121
interval: weekly
2222
reviewers:
2323
- "golangci/team"
24+
- package-ecosystem: gomod
25+
directory: "/scripts/gen_github_action_config"
26+
schedule:
27+
interval: weekly
28+
reviewers:
29+
- "golangci/team"

assets/github-action-config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"MinorVersionToConfig": {
3+
"latest": {
4+
"TargetVersion": "v1.29.0",
5+
"AssetURL": "https://github.com/golangci/golangci-lint/releases/download/v1.29.0/golangci-lint-1.29.0-linux-amd64.tar.gz"
6+
},
37
"v1.10": {
48
"Error": "golangci-lint version 'v1.10' isn't supported: we support only v1.14.0 and later versions"
59
},
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
module github.com/golangci/golangci-lint/scripts/gen_github_action_config
22

3-
go 1.13
3+
go 1.14
44

55
require (
6-
github.com/shurcooL/githubv4 v0.0.0-20200414012201-bbc966b061dd
6+
github.com/shurcooL/githubv4 v0.0.0-20200627185320-e003124d66e4
77
github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f // indirect
8-
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f // indirect
98
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
109
)
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
22
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
33
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
4-
github.com/shurcooL/githubv4 v0.0.0-20200414012201-bbc966b061dd h1:EwtC+kDj8s9OKiaStPZtTv3neldOyr98AXIxvmn3Gss=
5-
github.com/shurcooL/githubv4 v0.0.0-20200414012201-bbc966b061dd/go.mod h1:hAF0iLZy4td2EX+/8Tw+4nodhlMrwN3HupfaXj3zkGo=
4+
github.com/shurcooL/githubv4 v0.0.0-20200627185320-e003124d66e4 h1:cjmR6xY0f89IwBYMSwUrkFs4/1+KKw30Df3SqT7nZ6Q=
5+
github.com/shurcooL/githubv4 v0.0.0-20200627185320-e003124d66e4/go.mod h1:hAF0iLZy4td2EX+/8Tw+4nodhlMrwN3HupfaXj3zkGo=
66
github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f h1:tygelZueB1EtXkPI6mQ4o9DQ0+FKW41hTbunoXZCTqk=
77
github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f/go.mod h1:AuYgA5Kyo4c7HfUmvRGs/6rGlMMV/6B1bVnB9JxJEEg=
8-
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
98
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
109
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg=
1110
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
12-
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f h1:QBjCr1Fz5kw158VqdE9JfI9cJnl/ymnJWAdMuinqL7Y=
13-
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
1411
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
1512
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
1613
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
1714
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
18-
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
19-
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
2015
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
2116
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
2217
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=

scripts/gen_github_action_config/main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ func buildConfig(releases []release) (*actionConfig, error) {
153153
minorVersionToConfig := map[string]versionConfig{}
154154
minAllowedVersion := version{major: 1, minor: 14, patch: 0}
155155

156+
latestVersion := version{}
157+
latestVersionConfig := versionConfig{}
156158
for minorVersionedStr, maxPatchVersion := range maxPatchReleases {
157159
if !maxPatchVersion.isAfterOrEq(&minAllowedVersion) {
158160
minorVersionToConfig[minorVersionedStr] = versionConfig{
@@ -170,7 +172,13 @@ func buildConfig(releases []release) (*actionConfig, error) {
170172
TargetVersion: maxPatchVersion.String(),
171173
AssetURL: assetURL,
172174
}
175+
if maxPatchVersion.isAfterOrEq(&latestVersion) {
176+
latestVersion = maxPatchVersion
177+
latestVersionConfig.TargetVersion = maxPatchVersion.String()
178+
latestVersionConfig.AssetURL = assetURL
179+
}
173180
}
181+
minorVersionToConfig["latest"] = latestVersionConfig
174182

175183
return &actionConfig{MinorVersionToConfig: minorVersionToConfig}, nil
176184
}

0 commit comments

Comments
 (0)