|
|
@ -201,7 +201,7 @@ func (g *GiteaLocalUploader) CreateLabels(labels ...*base.Label) error { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// CreateReleases creates releases
|
|
|
|
// CreateReleases creates releases
|
|
|
|
func (g *GiteaLocalUploader) CreateReleases(syncTags bool, releases ...*base.Release) error { |
|
|
|
func (g *GiteaLocalUploader) CreateReleases(releases ...*base.Release) error { |
|
|
|
var rels = make([]*models.Release, 0, len(releases)) |
|
|
|
var rels = make([]*models.Release, 0, len(releases)) |
|
|
|
for _, release := range releases { |
|
|
|
for _, release := range releases { |
|
|
|
var rel = models.Release{ |
|
|
|
var rel = models.Release{ |
|
|
@ -288,16 +288,13 @@ func (g *GiteaLocalUploader) CreateReleases(syncTags bool, releases ...*base.Rel |
|
|
|
|
|
|
|
|
|
|
|
rels = append(rels, &rel) |
|
|
|
rels = append(rels, &rel) |
|
|
|
} |
|
|
|
} |
|
|
|
if err := models.InsertReleases(rels...); err != nil { |
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if syncTags { |
|
|
|
return models.InsertReleases(rels...) |
|
|
|
// sync tags to releases in database
|
|
|
|
|
|
|
|
return models.SyncReleasesWithTags(g.repo, g.gitRepo) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return nil |
|
|
|
// SyncTags syncs releases with tags in the database
|
|
|
|
|
|
|
|
func (g *GiteaLocalUploader) SyncTags() error { |
|
|
|
|
|
|
|
return models.SyncReleasesWithTags(g.repo, g.gitRepo) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// CreateIssues creates issues
|
|
|
|
// CreateIssues creates issues
|
|
|
|