From dfcc01acc593e880c32af31616fc1b3c79dd01e7 Mon Sep 17 00:00:00 2001 From: bdegeeter <76455484+bdegeeter@users.noreply.github.com> Date: Mon, 11 Apr 2022 12:23:21 -0700 Subject: [PATCH] XBuildAll expects to publish a mixin (#6) * XBuildAll expects to publish a mixin Fixes #4 Signed-off-by: Brian DeGeeter * XBuildAll expects to publish a mixin Fixes #4 Signed-off-by: Brian DeGeeter --- mixins/magefile.go | 1 + releases/build.go | 2 -- tools/install_test.go | 6 +++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mixins/magefile.go b/mixins/magefile.go index 822d4e1..62c94a9 100644 --- a/mixins/magefile.go +++ b/mixins/magefile.go @@ -35,6 +35,7 @@ func (m Magefile) Build() { // Cross-compile the mixin before a release func (m Magefile) XBuildAll() { releases.XBuildAll(m.Pkg, m.MixinName, m.BinDir) + releases.PrepareMixinForPublish(m.MixinName) } // Run unit tests diff --git a/releases/build.go b/releases/build.go index 4ed8fb9..0803f5e 100644 --- a/releases/build.go +++ b/releases/build.go @@ -85,6 +85,4 @@ func XBuildAll(pkg string, name string, binDir string) { // Copy most recent build into bin/dev so that subsequent build steps can easily find it, not used for publishing os.RemoveAll(filepath.Join(binDir, "dev")) shx.Copy(filepath.Join(binDir, info.Version), filepath.Join(binDir, "dev"), shx.CopyRecursive) - - PrepareMixinForPublish(name) } diff --git a/tools/install_test.go b/tools/install_test.go index 52dd65e..5dbdfef 100644 --- a/tools/install_test.go +++ b/tools/install_test.go @@ -1,15 +1,19 @@ package tools_test import ( + "testing" + "get.porter.sh/magefiles/tools" "github.com/carolynvs/magex/pkg" + "github.com/carolynvs/magex/pkg/gopath" + "github.com/carolynvs/magex/xplat" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "testing" ) func TestEnsureKind(t *testing.T) { tools.EnsureKind() + xplat.PrependPath(gopath.GetGopathBin()) found, err := pkg.IsCommandAvailable("kind", tools.DefaultKindVersion, "--version") require.NoError(t, err) assert.True(t, found)