Skip to content

Commit 209fc6f

Browse files
committed
Fix publishing and tagging
1 parent abac7a0 commit 209fc6f

3 files changed

Lines changed: 9 additions & 17 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
- name: earth +push
3535
if: github.ref == 'refs/heads/main'
36-
run: earth --push --secret NUGET_API_KEY --secret IB_PS_PUBLISH_KEY --strict +all
36+
run: earth --push --secret NUGET_API_KEY --secret IB_PS_PUBLISH_KEY --secret GITHUB_TOKEN --strict +all
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

build.build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ Add-BuildTask . Initialize, Build, Test
3939
Add-BuildTask Initialize $script:InitializeTasks
4040
Add-BuildTask Build $script:BuildTasks
4141
Add-BuildTask Test $script:TestTasks
42-
Add-BuildTask Publish $script:PublishTasks
42+
Add-BuildTask Pack $script:PackTasks
4343
Add-BuildTask Push $script:PushTasks

build.earth

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ARG --global IB_CONFIGURATION=Release
1818
# initialize installs build dependencies and packages
1919
initialize:
2020
# Dotnet tools and scripts installed by PSGet
21-
ENV PATH=$HOME/.dotnet/tools:$HOME/.local/share/powershell/Scripts:$PATH
21+
ENV PATH=$HOME/.dotnet/tools:$HOME/.local/share/powershell/Scripts:$PATH:${IB_TASK_ROOT}/scripts
2222
RUN mkdir $IB_TASK_ROOT $IB_OUTPUT_ROOT $IB_RESULTS_ROOT $IB_TEMP_ROOT \
2323
&& git config --global user.email "Jaykul@HuddledMasses.org" \
2424
&& git config --global user.name "Earth Build"
@@ -30,24 +30,16 @@ initialize:
3030
COPY --if-exists dotnet-tools.json .
3131
COPY --if-exists .config/dotnet-tools.json .
3232
# COPY --if-exists **/*.csproj .
33-
RUN -- pwsh -File "${IB_TASK_ROOT}/scripts/Invoke-Build.ps1" Initialize
34-
35-
# version calculates the version
36-
version:
37-
FROM +initialize
38-
# Copy .git because we use GitVersion in the build to calculate the version
39-
COPY .git .
40-
COPY GitVersion.yml .
41-
RUN -- pwsh -File "${IB_TASK_ROOT}/scripts/Invoke-Build.ps1" Get-Version
33+
RUN ["pwsh", "-CommandWithArgs", "Invoke-Build Initialize"]
4234

4335
# build produces the main output but does not package or test it
4436
build:
4537
# These are defined to make them available as information for the build scripts
4638
ARG EARTHLY_GIT_BRANCH
47-
FROM +version
39+
FROM +initialize
4840
# make sure you have output folders (like bin, obj, Modules) in .earthlyignore
4941
COPY . .
50-
RUN -- pwsh -File "${IB_TASK_ROOT}/scripts/Invoke-Build.ps1" Build
42+
RUN ["pwsh", "-CommandWithArgs", "Invoke-Build Build, Pack"]
5143

5244
# SAVE ARTIFACT [--keep-ts] [--keep-own] [--if-exists] [--force] <src> [<artifact-dest-path>] [AS LOCAL <local-path>]
5345
SAVE ARTIFACT $IB_OUTPUT_ROOT/$IB_MODULE_NAME AS LOCAL ./output/$IB_MODULE_NAME
@@ -57,7 +49,7 @@ test:
5749
ARG EARTHLY_GIT_BRANCH
5850
BUILD +build
5951
FROM +build
60-
RUN -- pwsh -File "${IB_TASK_ROOT}/scripts/Invoke-Build.ps1" Test
52+
RUN ["pwsh", "-CommandWithArgs", "Invoke-Build Test"]
6153
SAVE ARTIFACT $IB_RESULTS_ROOT AS LOCAL ./output$IB_RESULTS_ROOT
6254

6355
# publish runs publish and push tasks if the tests pass and --push was specified.
@@ -67,5 +59,5 @@ all:
6759
# If we only reference with FROM (or COPY) the outputs will not be produced
6860
BUILD +test
6961
FROM +build
70-
RUN --push --secret IB_PS_PUBLISH_KEY \
71-
-- pwsh -Command "${IB_TASK_ROOT}/scripts/Invoke-Build.ps1" "Publish,Push" -Verbose
62+
RUN --push --secret IB_PS_PUBLISH_KEY --secret GITHUB_TOKEN \
63+
-- pwsh -CommandWithArgs "Invoke-Build Push" -Verbose

0 commit comments

Comments
 (0)