CI: Run lerna bump version before yarn build (#107731)

lerna bump version before yarn build

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
Kevin Minehart
2025-07-08 14:58:45 +02:00
committed by GitHub
co-authored by Jack Westbrook
parent 35bf093201
commit 047349638d
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ func (f *Frontend) BuildFile(ctx context.Context, builder *dagger.Container, opt
}
func (f *Frontend) BuildDir(ctx context.Context, builder *dagger.Container, opts *pipeline.ArtifactContainerOpts) (*dagger.Directory, error) {
return frontend.Build(builder), nil
return frontend.Build(builder, f.Version), nil
}
func (f *Frontend) Publisher(ctx context.Context, opts *pipeline.ArtifactContainerOpts) (*dagger.Container, error) {
@@ -164,7 +164,7 @@ func NewTarball(
if err != nil {
return nil, err
}
frontendArtifact, err := NewFrontend(ctx, log, version, artifact, enterprise, src, cache)
frontendArtifact, err := NewFrontend(ctx, log, artifact, version, enterprise, src, cache)
if err != nil {
return nil, err
}
+4 -1
View File
@@ -1,11 +1,14 @@
package frontend
import (
"fmt"
"dagger.io/dagger"
)
func Build(builder *dagger.Container) *dagger.Directory {
func Build(builder *dagger.Container, version string) *dagger.Directory {
public := builder.
WithExec([]string{"/bin/sh", "-c", fmt.Sprintf("yarn lerna version %s --exact --no-git-tag-version --no-push --force-publish -y", version)}).
WithExec([]string{"yarn", "run", "build"}).
WithExec([]string{"/bin/sh", "-c", "find /src/public -type d -name node_modules -print0 | xargs -0 rm -rf"}).
Directory("/src/public")