1
- VERSION 0.7
1
+ VERSION 0.8
2
2
IMPORT github.com/poshcode/tasks
3
3
FROM mcr.microsoft.com/dotnet/sdk:9.0
4
4
WORKDIR /work
@@ -15,7 +15,7 @@ ARG --global MODULE_NAME=ModuleBuilder
15
15
ARG --global CONFIGURATION= Release
16
16
17
17
18
- worker :
18
+ bootstrap :
19
19
# Dotnet tools and scripts installed by PSGet
20
20
ENV PATH= $HOME /.dotnet/tools:$HOME /.local/share/powershell/Scripts:$PATH
21
21
RUN mkdir /Tasks \
@@ -30,7 +30,7 @@ worker:
30
30
RUN ["pwsh" , "-File" , "/Tasks/_Bootstrap.ps1" , "-RequiresPath" , "build.requires.psd1" ]
31
31
32
32
build :
33
- FROM +worker
33
+ FROM +bootstrap
34
34
RUN mkdir $OUTPUT_ROOT $TEST_ROOT $TEMP_ROOT
35
35
COPY . .
36
36
# make sure you have bin and obj in .earthlyignore, as their content from context might cause problems
@@ -41,26 +41,17 @@ build:
41
41
42
42
test :
43
43
# If we run a target as a reference in FROM or COPY, it's outputs will not be produced
44
- BUILD +build
45
44
FROM +build
46
45
# make sure you have bin and obj in .earthlyignore, as their content from context might cause problems
47
46
RUN ["pwsh" , "-Command" , "Invoke-Build" , "-Task" , "Test" , "-File" , "Build.build.ps1" ]
48
47
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
50
50
SAVE ARTIFACT $TEST_ROOT AS LOCAL ./Modules/$MODULE_NAME -TestResults
51
51
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
59
55
FROM +build
60
56
RUN --push --secret NUGET_API_KEY --secret PSGALLERY_API_KEY -- \
61
57
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