-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: test nupkg locally bash and powerhell
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env pwsh | ||
|
||
$scriptDir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent | ||
$scriptDir = Split-Path -Path $scriptDir -Parent | ||
|
||
Set-Location -Path $scriptDir | ||
|
||
# Clean and build the project | ||
dotnet clean .\solrevdev.seedfolder.sln | ||
dotnet restore .\solrevdev.seedfolder.sln | ||
dotnet build .\solrevdev.seedfolder.sln | ||
|
||
# Create an artifact folder | ||
$null = New-Item -Path .\artifacts -ItemType Directory -Force | ||
|
||
# Remove any old nupkg files | ||
Remove-Item -Path .\artifacts\nupkg\* -Recurse -Force | ||
|
||
# Package the dotnet tool | ||
dotnet pack .\solrevdev.seedfolder.sln -c Release -o .\artifacts\nupkg | ||
|
||
# Uninstall any version you currently have installed | ||
dotnet tool uninstall -g solrevdev.seedfolder | ||
|
||
# Install the version we have just built and packaged | ||
dotnet tool install -g --add-source .\artifacts\nupkg solrevdev.seedfolder | ||
|
||
# Run the tool | ||
seedfolder --help | ||
|
||
# Now uninstall the tool ready for the next run | ||
dotnet tool uninstall -g solrevdev.seedfolder | ||
|
||
# And install it again from nuget | ||
dotnet tool install -g solrevdev.seedfolder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
# shellcheck disable=SC2046 | ||
cd $(dirname "$0") || exit | ||
|
||
# clean and build the project | ||
dotnet clean ../solrevdev.seedfolder.sln | ||
dotnet restore ../solrevdev.seedfolder.sln | ||
dotnet build ../solrevdev.seedfolder.sln | ||
|
||
# create an artifact folder | ||
mkdir -p ../artifacts | ||
|
||
# remove any old nupkg files | ||
rm -rf ../artifacts/nupkg | ||
|
||
# package the dotnet tool | ||
dotnet pack ../solrevdev.seedfolder.sln -c release -o ../artifacts/nupkg | ||
|
||
# uninstall any version you currently have installed | ||
dotnet tool uninstall -g solrevdev.seedfolder | ||
|
||
# install the version we have just built and packaged | ||
dotnet tool install -g --add-source ../artifacts/nupkg solrevdev.seedfolder | ||
|
||
# run the tool | ||
seedfolder --help | ||
|
||
# now uninstall the tool ready for the next run | ||
dotnet tool uninstall -g solrevdev.seedfolder | ||
|
||
# and install it again from nuget | ||
dotnet tool install -g solrevdev.seedfolder |