Skip to content

Commit

Permalink
Normalizing paths a little
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaykul committed Nov 6, 2023
1 parent 604a351 commit 4ca2f8a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: Modules/Pansies

- uses: actions/upload-artifact@v3
with:
path: 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: Modules/Pansies-Packages
1 change: 1 addition & 0 deletions Build.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 3 additions & 11 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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] <src> [<artifact-dest-path>] [AS LOCAL <local-path>]
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 ./output/$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/

0 comments on commit 4ca2f8a

Please sign in to comment.