Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ go.work.sum
# Dependency directories (remove the comment below to include it)
# vendor/

dist/
dist/
hugoreleaser
8 changes: 6 additions & 2 deletions cmd/allcmd/allcmd.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 The Hugoreleaser Authors
// Copyright 2026 The Hugoreleaser Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,7 @@ import (
"github.com/gohugoio/hugoreleaser/cmd/archivecmd"
"github.com/gohugoio/hugoreleaser/cmd/buildcmd"
"github.com/gohugoio/hugoreleaser/cmd/corecmd"
"github.com/gohugoio/hugoreleaser/cmd/publishcmd"
"github.com/gohugoio/hugoreleaser/cmd/releasecmd"

"github.com/bep/logg"
Expand All @@ -39,14 +40,15 @@ func New(core *corecmd.Core) *ffcli.Command {
builder: builder,
archivist: archivecmd.NewArchivist(core),
releaser: releasecmd.NewReleaser(core, fs),
publisher: publishcmd.NewPublisher(core, fs),
}

core.RegisterFlags(fs)

return &ffcli.Command{
Name: commandName,
ShortUsage: corecmd.CommandName + " " + commandName + " [flags] <action>",
ShortHelp: "Runs the commands build, archive and release in sequence.",
ShortHelp: "Runs the commands build, archive, release and publish in sequence.",
FlagSet: fs,
Exec: a.Exec,
}
Expand All @@ -59,6 +61,7 @@ type all struct {
builder *buildcmd.Builder
archivist *archivecmd.Archivist
releaser *releasecmd.Releaser
publisher *publishcmd.Publisher
}

func (a *all) Init() error {
Expand All @@ -75,6 +78,7 @@ func (a *all) Exec(ctx context.Context, args []string) error {
a.builder,
a.archivist,
a.releaser,
a.publisher,
}

for _, commandHandler := range commandHandlers {
Expand Down
12 changes: 12 additions & 0 deletions cmd/corecmd/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,18 @@ func (c *Core) Init() error {
}
}

// Precompile publisher -> release mappings.
for i := range c.Config.Publishers {
pub := &c.Config.Publishers[i]
for j := range c.Config.Releases {
release := &c.Config.Releases[j]
// If no release paths specified, match all releases.
if pub.ReleasePathsCompiled == nil || pub.ReleasePathsCompiled.Match(release.Path) {
pub.ReleasesCompiled = append(pub.ReleasesCompiled, release)
}
}
}

// Registry for archive plugins.
c.PluginsRegistryArchive = make(map[string]*execrpc.Client[apimodel.Config, archiveplugin.Request, any, apimodel.Receipt])

Expand Down
Loading