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:
Sebastian Beisch
2021-02-24 22:38:15 +01:00
committed by Felix Wiedmann
parent 47a54436f5
commit c7d6c7cc7b
11 changed files with 294 additions and 39 deletions

View 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
}