1- VERSION 0.7
1+ VERSION 0.8
22IMPORT github.com/poshcode/tasks
33FROM mcr.microsoft.com/dotnet/sdk:9.0
44WORKDIR /work
@@ -15,7 +15,7 @@ ARG --global MODULE_NAME=ModuleBuilder
1515ARG --global CONFIGURATION= Release
1616
1717
18- worker :
18+ bootstrap :
1919 # Dotnet tools and scripts installed by PSGet
2020 ENV PATH= $HOME /.dotnet/tools:$HOME /.local/share/powershell/Scripts:$PATH
2121 RUN mkdir /Tasks \
@@ -30,7 +30,7 @@ worker:
3030 RUN ["pwsh" , "-File" , "/Tasks/_Bootstrap.ps1" , "-RequiresPath" , "build.requires.psd1" ]
3131
3232build :
33- FROM +worker
33+ FROM +bootstrap
3434 RUN mkdir $OUTPUT_ROOT $TEST_ROOT $TEMP_ROOT
3535 COPY . .
3636 # make sure you have bin and obj in .earthlyignore, as their content from context might cause problems
@@ -41,26 +41,17 @@ build:
4141
4242test :
4343 # If we run a target as a reference in FROM or COPY, it's outputs will not be produced
44- BUILD +build
4544 FROM +build
4645 # make sure you have bin and obj in .earthlyignore, as their content from context might cause problems
4746 RUN ["pwsh" , "-Command" , "Invoke-Build" , "-Task" , "Test" , "-File" , "Build.build.ps1" ]
4847
49- # SAVE ARTIFACT [--keep-ts] [--keep-own] [--if-exists] [--force] <src> [<artifact-dest-path>] [AS LOCAL <local-path>]
48+ # re-output the build output so we can rely on running just +test locally
49+ SAVE ARTIFACT $OUTPUT_ROOT/$MODULE_NAME AS LOCAL ./Modules/$MODULE_NAME
5050 SAVE ARTIFACT $TEST_ROOT AS LOCAL ./Modules/$MODULE_NAME -TestResults
5151
52- # pack:
53- # BUILD +test # So that we get the module artifact from build too
54- # FROM +test
55- # RUN ["pwsh", "-Command", "Invoke-Build", "-Task", "Pack", "-File", "Build.build.ps1", "-Verbose"]
56- # SAVE ARTIFACT $OUTPUT_ROOT/publish/*.nupkg AS LOCAL ./Modules/$MODULE_NAME-Packages/
57-
58- push :
52+ all :
53+ BUILD +build
54+ BUILD +test
5955 FROM +build
6056 RUN --push --secret NUGET_API_KEY --secret PSGALLERY_API_KEY -- \
6157 pwsh -Command Invoke-Build -Task Push -File Build.build.ps1 -Verbose
62-
63- all :
64- # BUILD +build
65- BUILD +test
66- BUILD +push
0 commit comments