2019-06-15 23:03:27 +02:00
|
|
|
package shared
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/Masterminds/semver"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
//ReleaseVersion struct
|
|
|
|
|
type ReleaseVersion struct {
|
2019-08-13 23:01:38 +02:00
|
|
|
Last ReleaseVersionEntry `yaml:"last"`
|
|
|
|
|
Next ReleaseVersionEntry `yaml:"next"`
|
|
|
|
|
Branch string `yaml:"branch"`
|
2019-08-11 18:27:52 +02:00
|
|
|
Commits map[Release][]AnalyzedCommit `yaml:"commits"`
|
2019-06-15 23:03:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//ReleaseVersionEntry struct
|
|
|
|
|
type ReleaseVersionEntry struct {
|
2019-08-13 23:01:38 +02:00
|
|
|
Commit string `yaml:"commit"`
|
|
|
|
|
VersionString string `yaml:"version"`
|
2019-08-11 18:27:52 +02:00
|
|
|
Version *semver.Version `yaml:"-"`
|
2019-06-15 23:03:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//GeneratedChangelog struct
|
|
|
|
|
type GeneratedChangelog struct {
|
|
|
|
|
Title string
|
|
|
|
|
Content string
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-20 00:46:59 +02:00
|
|
|
//ChangelogTemplateConfig struct
|
2019-06-15 23:03:27 +02:00
|
|
|
type ChangelogTemplateConfig struct {
|
|
|
|
|
CommitURL string
|
|
|
|
|
CompareURL string
|
|
|
|
|
Hash string
|
|
|
|
|
Version string
|
|
|
|
|
}
|
2019-08-11 18:27:52 +02:00
|
|
|
|
|
|
|
|
//AnalyzedCommit struct
|
|
|
|
|
type AnalyzedCommit struct {
|
2022-04-11 15:58:37 +02:00
|
|
|
Commit Commit `yaml:"commit"`
|
|
|
|
|
ParsedMessage string `yaml:"parsedMessage"`
|
|
|
|
|
Author string `yaml:"author"`
|
|
|
|
|
ParsedBreakingChangeMessage string `yaml:"parsedBreakingChangeMessage"`
|
|
|
|
|
Tag string `yaml:"tag"`
|
|
|
|
|
TagString string `yaml:"tagString"`
|
|
|
|
|
Scope Scope `yaml:"scope"`
|
|
|
|
|
Subject string `yaml:"subject"`
|
|
|
|
|
MessageBlocks map[string][]MessageBlock `yaml:"messageBlocks"`
|
|
|
|
|
IsBreaking bool `yaml:"isBreaking"`
|
|
|
|
|
Print bool `yaml:"print"`
|
2019-08-11 18:27:52 +02:00
|
|
|
}
|
|
|
|
|
|
2021-02-16 15:25:34 +01:00
|
|
|
// MessageBlock represents a block in the body section of a commit message
|
|
|
|
|
type MessageBlock struct {
|
2022-04-11 15:58:37 +02:00
|
|
|
Label string `yaml:"label"`
|
2021-02-16 15:25:34 +01:00
|
|
|
Content string `yaml:"content"`
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-11 18:27:52 +02:00
|
|
|
//Scope of the commit, like feat, fix,..
|
|
|
|
|
type Scope string
|
|
|
|
|
|
|
|
|
|
//Release types, like major
|
|
|
|
|
type Release string
|
|
|
|
|
|
|
|
|
|
// Commit struct
|
|
|
|
|
type Commit struct {
|
|
|
|
|
Message string `yaml:"message"`
|
|
|
|
|
Author string `yaml:"author"`
|
|
|
|
|
Hash string `yaml:"hash"`
|
|
|
|
|
}
|