You've already forked go-semantic-release
feat(integrations): add first simple npm integration
Integrations are simple helpers to make integration with existing tools easier.
At basic npm support, the integration will set the version before release to the `package.json`
```yml
integrations:
npm:
enabled: true
```
This commit is contained in:
committed by
Felix Wiedmann
parent
47a54436f5
commit
c7d6c7cc7b
26
internal/integrations/integrations.go
Normal file
26
internal/integrations/integrations.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package integrations
|
||||
|
||||
import (
|
||||
"github.com/Nightapes/go-semantic-release/internal/shared"
|
||||
"github.com/Nightapes/go-semantic-release/pkg/config"
|
||||
)
|
||||
|
||||
// Integrations struct
|
||||
type Integrations struct {
|
||||
version *shared.ReleaseVersion
|
||||
config *config.Integrations
|
||||
}
|
||||
|
||||
func New(config *config.Integrations, version *shared.ReleaseVersion) *Integrations {
|
||||
return &Integrations{
|
||||
config: config,
|
||||
version: version,
|
||||
}
|
||||
}
|
||||
|
||||
func (i Integrations) Run() error {
|
||||
if i.config.NPM.Enabled {
|
||||
return i.updateNPM()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user