Skip to content

Commit

Permalink
feat: add known github plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwitzko committed Feb 4, 2023
1 parent d38f5b1 commit 1e7c72c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 13 deletions.
6 changes: 6 additions & 0 deletions pkg/plugin/discovery/resolver/github/github.go
Expand Up @@ -18,6 +18,8 @@ import (
"golang.org/x/oauth2"
)

var _ resolver.Resolver = &Resolver{}

type Resolver struct {
ghClient *github.Client
}
Expand Down Expand Up @@ -105,6 +107,10 @@ func (g *Resolver) getAllValidGitHubReleases(repoOwner, repoName string) (ghRele
continue
}

if len(release.Assets) == 0 {
continue
}

if semverTag, err := semver.NewVersion(release.GetTagName()); err == nil {
ret = append(ret, &ghRelease{version: semverTag, release: release})
}
Expand Down
27 changes: 14 additions & 13 deletions pkg/plugin/discovery/resolver/github/known_plugins.go
@@ -1,17 +1,18 @@
package github

var knownPlugins = map[string]string{
"provider-github": "go-semantic-release/provider-github",
"provider-gitlab": "go-semantic-release/provider-gitlab",
"changelog-generator-default": "go-semantic-release/changelog-generator-default",
"commit-analyzer-default": "go-semantic-release/commit-analyzer-cz",
"condition-default": "go-semantic-release/condition-default",
"condition-github": "go-semantic-release/condition-github",
"condition-gitlab": "go-semantic-release/condition-gitlab",
"files-updater-npm": "go-semantic-release/files-updater-npm",
"provider-git": "go-semantic-release/provider-git",
"condition-bitbucket": "go-semantic-release/condition-bitbucket",
"files-updater-helm": "go-semantic-release/files-updater-helm",
"hooks-goreleaser": "go-semantic-release/hooks-goreleaser",
"hooks-npm-binary-releaser": "go-semantic-release/hooks-npm-binary-releaser",
"provider-github": "go-semantic-release/provider-github",
"provider-gitlab": "go-semantic-release/provider-gitlab",
"changelog-generator-default": "go-semantic-release/changelog-generator-default",
"commit-analyzer-default": "go-semantic-release/commit-analyzer-cz",
"condition-default": "go-semantic-release/condition-default",
"condition-github": "go-semantic-release/condition-github",
"condition-gitlab": "go-semantic-release/condition-gitlab",
"files-updater-npm": "go-semantic-release/files-updater-npm",
"provider-git": "go-semantic-release/provider-git",
"condition-bitbucket": "go-semantic-release/condition-bitbucket",
"files-updater-helm": "go-semantic-release/files-updater-helm",
"hooks-goreleaser": "go-semantic-release/hooks-goreleaser",
"hooks-npm-binary-releaser": "go-semantic-release/hooks-npm-binary-releaser",
"hooks-plugin-registry-update": "go-semantic-release/hooks-plugin-registry-update",
}
5 changes: 5 additions & 0 deletions pkg/plugin/discovery/resolver/registry/registry.go
Expand Up @@ -13,6 +13,11 @@ import (
"github.com/go-semantic-release/semantic-release/v2/pkg/plugin/discovery/resolver"
)

var (
_ resolver.Resolver = &Resolver{}
_ resolver.BatchResolver = &Resolver{}
)

type Resolver struct {
client *client.Client
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/plugin/discovery/resolver/registryV1/registry.go
Expand Up @@ -14,6 +14,8 @@ import (

const DefaultEndpoint = "https://plugins.go-semantic-release.xyz/api/v1"

var _ resolver.Resolver = &Resolver{}

type Resolver struct {
endpoint string
}
Expand Down

0 comments on commit 1e7c72c

Please sign in to comment.