Skip to content

Commit 2e0a320

Browse files
feat: update plugins
1 parent 206cc35 commit 2e0a320

File tree

3 files changed

+33
-110
lines changed

3 files changed

+33
-110
lines changed

go.mod

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ go 1.14
44

55
require (
66
github.com/Masterminds/semver/v3 v3.1.0
7-
github.com/go-semantic-release/changelog-generator-default v1.0.0
8-
github.com/go-semantic-release/commit-analyzer-cz v1.0.1
9-
github.com/go-semantic-release/condition-default v1.0.0
10-
github.com/go-semantic-release/condition-github v1.0.1
11-
github.com/go-semantic-release/condition-gitlab v1.0.1
12-
github.com/go-semantic-release/files-updater-npm v1.0.0
13-
github.com/go-semantic-release/provider-github v1.1.1
14-
github.com/go-semantic-release/provider-gitlab v1.1.1
7+
github.com/go-semantic-release/changelog-generator-default v1.2.0
8+
github.com/go-semantic-release/commit-analyzer-cz v1.1.0
9+
github.com/go-semantic-release/condition-default v1.1.0
10+
github.com/go-semantic-release/condition-github v1.1.0
11+
github.com/go-semantic-release/condition-gitlab v1.1.0
12+
github.com/go-semantic-release/files-updater-npm v1.1.0
13+
github.com/go-semantic-release/provider-github v1.2.0
14+
github.com/go-semantic-release/provider-gitlab v1.2.0
1515
github.com/golang/protobuf v1.4.2
1616
github.com/hashicorp/go-hclog v0.14.1
1717
github.com/hashicorp/go-plugin v1.3.0

go.sum

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,38 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9
6262
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
6363
github.com/go-semantic-release/changelog-generator-default v1.0.0 h1:ECzGSl/eiSZUGP1nH+GXobBhjDsL7s7etCrbnvtXQQo=
6464
github.com/go-semantic-release/changelog-generator-default v1.0.0/go.mod h1:ohiIkjB+y8CdShomyVWnSzbH7o51bujni+hVc27yDEs=
65+
github.com/go-semantic-release/changelog-generator-default v1.2.0 h1:Xn86FJnBKuavftHVsXl7H4VHs4/e6Q6OzwN57nqON30=
66+
github.com/go-semantic-release/changelog-generator-default v1.2.0/go.mod h1:90CjPPa8dUnAA+9rcIHVDKSmcjQPIWrXYIp9o+6Vd6E=
6567
github.com/go-semantic-release/commit-analyzer-cz v1.0.1 h1:tB3T93NO8cLxtu8FVJp/qRg3B8o+4IgUEbwE9OuzS3s=
6668
github.com/go-semantic-release/commit-analyzer-cz v1.0.1/go.mod h1:H30LymC5l0bI1tj7wxHD5fvvINcu0vhC6akfhr4yHVQ=
69+
github.com/go-semantic-release/commit-analyzer-cz v1.1.0 h1:RHQwhtYWmXUyxa+G3x9vsVgiOvld/mCSTEEing2Fpso=
70+
github.com/go-semantic-release/commit-analyzer-cz v1.1.0/go.mod h1:/3pSUc46GQH8mQXYdIYaEhc0dl+hpyj1OYKJOgBBg38=
6771
github.com/go-semantic-release/condition-default v1.0.0 h1:fqBeH6Vhxye1Ox2qSs4Af1kHUe6gRwkWzd6uDOopJbg=
6872
github.com/go-semantic-release/condition-default v1.0.0/go.mod h1:FDiP/H4k8flsSZ6y8/BEAXZ7pr/e9Z9sbVBV6XlXGs8=
73+
github.com/go-semantic-release/condition-default v1.1.0 h1:vyECN9ZRRLWR40otAyThJVxLl/NbFArLkcGJiYBtbhM=
74+
github.com/go-semantic-release/condition-default v1.1.0/go.mod h1:PJpJB6y7vvABhJmz9ZkrY7Qw/Whl7rx18nqkWEzyEgo=
6975
github.com/go-semantic-release/condition-github v1.0.1 h1:xE47xFckOjOXzQzsusJVeGtZzKhEQD9CmKVyFJncTfE=
7076
github.com/go-semantic-release/condition-github v1.0.1/go.mod h1:5LwGLxvGChlLhNmtT+p2SAhDQQ43cUAfO8FZobD0d/o=
77+
github.com/go-semantic-release/condition-github v1.1.0 h1:xUosSUfwEAa9cgcrI1rz79ZFn1iGkL5MoO8LXtXqH0w=
78+
github.com/go-semantic-release/condition-github v1.1.0/go.mod h1:iGxVYCrE62DH48RO4jaiHwGSZctM8UIdeXXBJwpZ8Jk=
7179
github.com/go-semantic-release/condition-gitlab v1.0.1 h1:dg7YxwV8wvAzaXpBNhRheg8WzWi9tvghTg3irfi1Nd0=
7280
github.com/go-semantic-release/condition-gitlab v1.0.1/go.mod h1:/5eOZU9YhqTja5VwgX91hzx97Xn3lSVP2RrKJuYUZpU=
81+
github.com/go-semantic-release/condition-gitlab v1.1.0 h1:nbiTr1Eld5+38OgkN7KXbZgb+xRhRdN4lHtatJMn3Kg=
82+
github.com/go-semantic-release/condition-gitlab v1.1.0/go.mod h1:vNwsx0IbK8zKRlDRNr/T1W5RhaobBFe9tJ8pEuYUvkg=
7383
github.com/go-semantic-release/files-updater-npm v1.0.0 h1:rW5St9lC1YfJ8oHB2qvWsufaE6re1XCK1GgbIPrr/k8=
7484
github.com/go-semantic-release/files-updater-npm v1.0.0/go.mod h1:MWirt5ni103snq5b2raddrrWpuZy8/bF0xHe4Rluq3M=
85+
github.com/go-semantic-release/files-updater-npm v1.1.0 h1:8ilL/ZCW4+ohq+LpDp38VNbuA6m71Xyryz0gLx4trvM=
86+
github.com/go-semantic-release/files-updater-npm v1.1.0/go.mod h1:qldlgUh3k7zgaMDVvmEuYH9IkDcmJX+2Kc6i31fsaoY=
7587
github.com/go-semantic-release/provider-github v1.1.1 h1:YrVAVcGazqBcYggR/V3TKL5tS8hqlMChRshkJU6p7Sc=
7688
github.com/go-semantic-release/provider-github v1.1.1/go.mod h1:9vCDagOqx0kXyHOAI93Tdl/9GVeOyCKVHWcIp1RJwNI=
89+
github.com/go-semantic-release/provider-github v1.2.0 h1:QHeP2weQ/TyZfQX77V7bNwuoB4PPaRcrRfSMkRwY26A=
90+
github.com/go-semantic-release/provider-github v1.2.0/go.mod h1:s/wAr/9oR1sKsaTo2XtMv8YuhEGxZzSCrGRbsDVGFXQ=
7791
github.com/go-semantic-release/provider-gitlab v1.1.1 h1:t04xvGuz4mdfLN2vG438pw+Xo0eVaEFSkANtgIQekNM=
7892
github.com/go-semantic-release/provider-gitlab v1.1.1/go.mod h1:sHrVeyN4d9HVJs1ejwW7P1m7aV74D0oDhk2PP07syBA=
93+
github.com/go-semantic-release/provider-gitlab v1.2.0 h1:LGkJTZ1Ofop31Wi6DEdlZQkwJP/EoGFOYtF0Z/BUSQw=
94+
github.com/go-semantic-release/provider-gitlab v1.2.0/go.mod h1:sgDlqrfGWe+qXgANAqziPkWgyHjmIYqkjmoDWv6PH+0=
7995
github.com/go-semantic-release/semantic-release/v2 v2.1.0/go.mod h1:VSiaMm0rYu2A2OOmmgaXFFVHVAyrQQDMlpLQO0lEZ4k=
96+
github.com/go-semantic-release/semantic-release/v2 v2.3.0/go.mod h1:KdDFJ2fO60CV1sZoSiwH4b8toZ/6qKfoaK8rXdupoHI=
8097
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
8198
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
8299
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=

pkg/plugin/buildin/buildin.go

Lines changed: 8 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -18,112 +18,18 @@ import (
1818
"github.com/go-semantic-release/semantic-release/v2/pkg/generator"
1919
"github.com/go-semantic-release/semantic-release/v2/pkg/plugin"
2020
"github.com/go-semantic-release/semantic-release/v2/pkg/provider"
21-
"github.com/go-semantic-release/semantic-release/v2/pkg/semrel"
2221
"github.com/go-semantic-release/semantic-release/v2/pkg/updater"
2322
"github.com/spf13/cobra"
2423
)
2524

26-
type tempCommitAnalyzerInterface interface {
27-
Analyze(commits []*semrel.RawCommit) []*semrel.Commit
28-
}
29-
30-
type tempCommitAnalyzerWrapper struct {
31-
tempCommitAnalyzerInterface
32-
}
33-
34-
func (*tempCommitAnalyzerWrapper) Init(m map[string]string) error {
35-
return nil
36-
}
37-
38-
func (*tempCommitAnalyzerWrapper) Name() string {
39-
return "default"
40-
}
41-
42-
func (*tempCommitAnalyzerWrapper) Version() string {
43-
return "dev"
44-
}
45-
46-
type tempCIInterface interface {
47-
Name() string
48-
RunCondition(m map[string]string) error
49-
GetCurrentBranch() string
50-
GetCurrentSHA() string
51-
}
52-
53-
type tempCIWrapper struct {
54-
tempCIInterface
55-
}
56-
57-
func (*tempCIWrapper) Version() string {
58-
return "dev"
59-
}
60-
61-
type tempChangelogGeneratorInterface interface {
62-
Generate(config *generator.ChangelogGeneratorConfig) string
63-
}
64-
65-
type tempChangelogGeneratorWrapper struct {
66-
tempChangelogGeneratorInterface
67-
}
68-
69-
func (*tempChangelogGeneratorWrapper) Init(m map[string]string) error {
70-
return nil
71-
}
72-
73-
func (*tempChangelogGeneratorWrapper) Name() string {
74-
return "default"
75-
}
76-
77-
func (*tempChangelogGeneratorWrapper) Version() string {
78-
return "dev"
79-
}
80-
81-
type tempProviderInterface interface {
82-
Init(map[string]string) error
83-
Name() string
84-
GetInfo() (*provider.RepositoryInfo, error)
85-
GetCommits(sha string) ([]*semrel.RawCommit, error)
86-
GetReleases(re string) ([]*semrel.Release, error)
87-
CreateRelease(*provider.CreateReleaseConfig) error
88-
}
89-
90-
type tempProviderWrapper struct {
91-
tempProviderInterface
92-
}
93-
94-
func (*tempProviderWrapper) Version() string {
95-
return "dev"
96-
}
97-
98-
type tempFilesUpdaterInterface interface {
99-
ForFiles() string
100-
Apply(file, newVersion string) error
101-
}
102-
103-
type tempFilesUpdaterWrapper struct {
104-
tempFilesUpdaterInterface
105-
}
106-
107-
func (*tempFilesUpdaterWrapper) Init(m map[string]string) error {
108-
return nil
109-
}
110-
111-
func (*tempFilesUpdaterWrapper) Name() string {
112-
return "default"
113-
}
114-
115-
func (*tempFilesUpdaterWrapper) Version() string {
116-
return "dev"
117-
}
118-
11925
func RegisterPluginCommands(cmd *cobra.Command) {
12026
cmd.AddCommand([]*cobra.Command{
12127
{
12228
Use: analyzer.CommitAnalyzerPluginName,
12329
Run: func(cmd *cobra.Command, args []string) {
12430
plugin.Serve(&plugin.ServeOpts{
12531
CommitAnalyzer: func() analyzer.CommitAnalyzer {
126-
return &tempCommitAnalyzerWrapper{&defaultAnalyzer.DefaultCommitAnalyzer{}}
32+
return &defaultAnalyzer.DefaultCommitAnalyzer{}
12733
},
12834
})
12935
},
@@ -134,7 +40,7 @@ func RegisterPluginCommands(cmd *cobra.Command) {
13440
Run: func(cmd *cobra.Command, args []string) {
13541
plugin.Serve(&plugin.ServeOpts{
13642
CICondition: func() condition.CICondition {
137-
return &tempCIWrapper{&defaultCI.DefaultCI{}}
43+
return &defaultCI.DefaultCI{}
13844
},
13945
})
14046
},
@@ -145,7 +51,7 @@ func RegisterPluginCommands(cmd *cobra.Command) {
14551
Run: func(cmd *cobra.Command, args []string) {
14652
plugin.Serve(&plugin.ServeOpts{
14753
CICondition: func() condition.CICondition {
148-
return &tempCIWrapper{&githubCI.GitHubActions{}}
54+
return &githubCI.GitHubActions{}
14955
},
15056
})
15157
},
@@ -156,7 +62,7 @@ func RegisterPluginCommands(cmd *cobra.Command) {
15662
Run: func(cmd *cobra.Command, args []string) {
15763
plugin.Serve(&plugin.ServeOpts{
15864
CICondition: func() condition.CICondition {
159-
return &tempCIWrapper{&gitlabCI.GitLab{}}
65+
return &gitlabCI.GitLab{}
16066
},
16167
})
16268
},
@@ -167,7 +73,7 @@ func RegisterPluginCommands(cmd *cobra.Command) {
16773
Run: func(cmd *cobra.Command, args []string) {
16874
plugin.Serve(&plugin.ServeOpts{
16975
ChangelogGenerator: func() generator.ChangelogGenerator {
170-
return &tempChangelogGeneratorWrapper{&defaultGenerator.DefaultChangelogGenerator{}}
76+
return &defaultGenerator.DefaultChangelogGenerator{}
17177
},
17278
})
17379
},
@@ -178,7 +84,7 @@ func RegisterPluginCommands(cmd *cobra.Command) {
17884
Run: func(cmd *cobra.Command, args []string) {
17985
plugin.Serve(&plugin.ServeOpts{
18086
Provider: func() provider.Provider {
181-
return &tempProviderWrapper{&providerGithub.GitHubRepository{}}
87+
return &providerGithub.GitHubRepository{}
18288
},
18389
})
18490
},
@@ -189,7 +95,7 @@ func RegisterPluginCommands(cmd *cobra.Command) {
18995
Run: func(cmd *cobra.Command, args []string) {
19096
plugin.Serve(&plugin.ServeOpts{
19197
Provider: func() provider.Provider {
192-
return &tempProviderWrapper{&providerGitlab.GitLabRepository{}}
98+
return &providerGitlab.GitLabRepository{}
19399
},
194100
})
195101
},
@@ -200,7 +106,7 @@ func RegisterPluginCommands(cmd *cobra.Command) {
200106
Run: func(cmd *cobra.Command, args []string) {
201107
plugin.Serve(&plugin.ServeOpts{
202108
FilesUpdater: func() updater.FilesUpdater {
203-
return &tempFilesUpdaterWrapper{&npmUpdater.Updater{}}
109+
return &npmUpdater.Updater{}
204110
},
205111
})
206112
},

0 commit comments

Comments
 (0)