mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-03 13:11:48 +02:00
feat: publish snaps
This commit is contained in:
parent
fac4b621b0
commit
04ee42caed
@ -109,9 +109,7 @@ func (Pipe) Publish(ctx *context.Context) error {
|
||||
for _, snap := range snaps {
|
||||
snap := snap
|
||||
g.Go(func() error {
|
||||
// TODO
|
||||
log.Info(snap.Path)
|
||||
return nil
|
||||
return push(ctx, snap)
|
||||
})
|
||||
}
|
||||
return g.Wait()
|
||||
@ -205,3 +203,13 @@ func create(ctx *context.Context, arch string, binaries []artifact.Artifact) err
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
func push(ctx *context.Context, snap artifact.Artifact) error {
|
||||
var cmd = exec.CommandContext(ctx, "snapcraft", "push", "--release=stable", snap.Path)
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
return fmt.Errorf("failed to push %s package: %s", snap.Path, string(out))
|
||||
}
|
||||
snap.Type = artifact.Snapcraft
|
||||
ctx.Artifacts.Add(snap)
|
||||
return nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user