From b226aaafd136e8aed16419bc77daccc00461ffdf Mon Sep 17 00:00:00 2001 From: Joel Bennett Date: Sun, 5 Nov 2023 23:27:24 -0500 Subject: [PATCH] Normalizing paths a little --- .github/workflows/build.yaml | 28 +++++++++++++--------------- Build.build.ps1 | 1 + Earthfile | 16 ++++------------ 3 files changed, 18 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 23fb2f8..0e2be45 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,25 +15,23 @@ jobs: - uses: earthly/actions-setup@v1 with: version: v0.7.21 + - uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 - - name: Put back the git branch into git (Earthly uses it for tagging) - run: | - branch="" - if [ -n "$GITHUB_HEAD_REF" ]; then - branch="$GITHUB_HEAD_REF" - else - branch="${GITHUB_REF##*/}" - fi - git checkout -b "$branch" || true - - name: earthly +build - run: earthly +build + - name: earthly +publish + run: earthly --ci +publish + + - uses: actions/upload-artifact@v3 + with: + path: ${{github.workspace}}/Modules/Pansies + + - uses: actions/upload-artifact@v3 + with: + path: ${{github.workspace}}/Modules/Pansies-TestResults - - name: Upload Build Output - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: - name: output - path: ${{github.workspace}}/output + path: ${{github.workspace}}/Modules/Pansies-Packages diff --git a/Build.build.ps1 b/Build.build.ps1 index 90bb2fd..542fdd1 100644 --- a/Build.build.ps1 +++ b/Build.build.ps1 @@ -41,6 +41,7 @@ $ErrorView = 'DetailedView' # The name of the module to publish $script:PSModuleName = "TerminalBlocks" +$script:OutputRoot = Join-Path $BuildRoot Modules $Tasks = "Tasks", "../Tasks", "../../Tasks" | Convert-Path -ErrorAction Ignore | Select-Object -First 1 Write-Information "$($PSStyle.Foreground.BrightCyan)Found shared tasks in $Tasks" -Tag "InvokeBuild" diff --git a/Earthfile b/Earthfile index 45cd86a..6641607 100644 --- a/Earthfile +++ b/Earthfile @@ -6,7 +6,7 @@ WORKDIR /project ARG --global EARTHLY_BUILD_SHA ARG --global EARTHLY_GIT_BRANCH # These are my common paths, used in my shared /Tasks repo -ARG --global OUTPUT_ROOT=/output +ARG --global OUTPUT_ROOT=/Modules ARG --global TEST_ROOT=/tests ARG --global TEMP_ROOT=/temp # These are my common build args, used in my shared /Tasks repo @@ -26,8 +26,6 @@ deps: COPY RequiredModules.psd1 . COPY *.csproj . RUN ["pwsh", "--file", "/Tasks/_Bootstrap.ps1", "-RequiredModulesPath", "RequiredModules.psd1"] - # Install-RequiredModule does not support pre-release modules - RUN ["pwsh", "--command", "Update-Module", "ModuleBuilder", "-AllowPreRelease"] build: FROM +deps @@ -37,7 +35,7 @@ build: RUN ["pwsh", "--command", "Invoke-Build", "-Task", "Build", "-File", "Build.build.ps1"] # SAVE ARTIFACT [--keep-ts] [--keep-own] [--if-exists] [--force] [] [AS LOCAL ] - SAVE ARTIFACT $OUTPUT_ROOT/$MODULE_NAME AS LOCAL ./output/$MODULE_NAME + SAVE ARTIFACT $OUTPUT_ROOT/$MODULE_NAME AS LOCAL ./Modules/$MODULE_NAME test: FROM +build @@ -46,15 +44,9 @@ test: RUN ["pwsh", "--command", "Invoke-Build", "-Task", "Test", "-File", "Build.build.ps1"] # SAVE ARTIFACT [--keep-ts] [--keep-own] [--if-exists] [--force] [] [AS LOCAL ] - SAVE ARTIFACT $TEST_ROOT AS LOCAL ./output/tests -# runtime: -# FROM mcr.microsoft.com/dotnet/aspnet:7.0 -# WORKDIR /app -# COPY +build/output . -# ENTRYPOINT ["dotnet", "ContainerApp.WebApp.dll"] -# SAVE IMAGE --push containerapp-webapp:earthly + SAVE ARTIFACT $TEST_ROOT AS LOCAL ./Modules/$MODULE_NAME-TestResults publish: FROM +build RUN ["pwsh", "--command", "Invoke-Build", "-Task", "Publish", "-File", "Build.build.ps1", "-Verbose"] - SAVE ARTIFACT $OUTPUT_ROOT/publish AS LOCAL ./output/publish + SAVE ARTIFACT $OUTPUT_ROOT/publish/*.nupkg AS LOCAL ./Modules/$MODULE_NAME-Packages/