Skip to content

Commit

Permalink
Fix missing git user config
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaykul committed Nov 12, 2023
1 parent 14d764f commit 9ac9168
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ jobs:
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.7.21
# version: v0.7.21
github-token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: earthly +github
run: earthly --strict +github
- name: earthly +all
run: earthly --strict +all

- uses: actions/upload-artifact@v3
with:
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"editor.insertSpaces": true,
"powershell.codeFormatting.preset": "OTBS",
"powershell.codeFormatting.ignoreOneLineBlock": false,
"powershell.codeFormatting.newLineAfterCloseBrace": false,
"powershell.codeFormatting.useCorrectCasing": true,
"powershell.codeFormatting.alignPropertyValuePairs": true,
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline",
Expand Down
29 changes: 17 additions & 12 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION 0.7
IMPORT github.com/poshcode/tasks
FROM mcr.microsoft.com/dotnet/sdk:7.0
WORKDIR /project
WORKDIR /work

ARG --global EARTHLY_BUILD_SHA
ARG --global EARTHLY_GIT_BRANCH
Expand All @@ -15,10 +15,12 @@ ARG --global CONFIGURATION=Release
ARG --global PSMODULE_PUBLISH_KEY
ARG --global NUGET_API_KEY

deps:
worker:
# Dotnet tools and scripts installed by PSGet
ENV PATH=$HOME/.dotnet/tools:$HOME/.local/share/powershell/Scripts:$PATH
RUN mkdir /Tasks
RUN mkdir /Tasks \
&& git config --global user.email "[email protected]" \
&& git config --global user.name "Earthly Build"
# I'm using Invoke-Build tasks from this other repo which rarely changes
COPY tasks+tasks/* /Tasks
# Dealing with dependencies first allows docker to cache packages for us
Expand All @@ -28,7 +30,7 @@ deps:
RUN ["pwsh", "--file", "/Tasks/_Bootstrap.ps1", "-RequiredModulesPath", "RequiredModules.psd1"]

build:
FROM +deps
FROM +worker
RUN mkdir $OUTPUT_ROOT $TEST_ROOT $TEMP_ROOT
COPY . .
# make sure you have bin and obj in .earthlyignore, as their content from context might cause problems
Expand All @@ -38,22 +40,25 @@ build:
SAVE ARTIFACT $OUTPUT_ROOT/$MODULE_NAME AS LOCAL ./Modules/$MODULE_NAME

test:
# If we run a target as a reference in FROM or COPY, it's outputs will not be produced
FROM +build
COPY . .
# make sure you have bin and obj in .earthlyignore, as their content from context might cause problems
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 ./Modules/$MODULE_NAME-TestResults

pack:
BUILD +build # So that we get the build artifact too
FROM +build
RUN ["pwsh", "--command", "Invoke-Build", "-Task", "Pack", "-File", "Build.build.ps1", "-Verbose"]
SAVE ARTIFACT $OUTPUT_ROOT/publish/*.nupkg AS LOCAL ./Modules/$MODULE_NAME-Packages/

publish:
FROM +build
RUN ["pwsh", "--command", "Invoke-Build", "-Task", "Publish", "-File", "Build.build.ps1", "-Verbose"]
SAVE ARTIFACT $OUTPUT_ROOT/publish/*.nupkg AS LOCAL ./Modules/$MODULE_NAME-Packages/

# this literally exists just to publish all the artifact from one step
github:
FROM +publish
SAVE ARTIFACT $OUTPUT_ROOT/$MODULE_NAME AS LOCAL ./Modules/$MODULE_NAME
SAVE ARTIFACT $TEST_ROOT AS LOCAL ./Modules/$MODULE_NAME-TestResults
SAVE ARTIFACT $OUTPUT_ROOT/publish/*.nupkg AS LOCAL ./Modules/$MODULE_NAME-Packages/
all:
# BUILD +build
BUILD +test
BUILD +pack

0 comments on commit 9ac9168

Please sign in to comment.