-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add icon to dotnet tool NuGet package #905
Changes from all commits
7e2b209
65d2d88
3a46451
bdb3a9a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,14 @@ | |
<version>$version$</version> | ||
<description>Secure, cross-platform Git credential storage with authentication to Azure Repos, GitHub, and other popular Git hosting services.</description> | ||
<authors>git-credential-manager</authors> | ||
<icon>images\icon.png</icon> | ||
<iconUrl>https://raw.githubusercontent.com/GitCredentialManager/git-credential-manager/main/assets/gcm-transparent.png</iconUrl> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Newer tools will only use |
||
<packageTypes> | ||
<packageType name="DotnetTool" /> | ||
</packageTypes> | ||
</metadata> | ||
<files> | ||
<file src="$publishdir$" target="tools/net6.0/any" /> | ||
<file src="$publishdir$payload/" target="tools/net6.0/any" /> | ||
<file src="$publishdir$images/icon.png" target="images" /> | ||
Comment on lines
+15
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
</files> | ||
</package> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ make_absolute () { | |
##################################################################### | ||
# Lay out | ||
##################################################################### | ||
echo "Laying out files for dotnet tool..." | ||
# Parse script arguments | ||
for i in "$@" | ||
do | ||
|
@@ -38,7 +37,7 @@ esac | |
done | ||
|
||
if [ -z "$VERSION" ]; then | ||
VERSION="$GitBuildVersionSimple" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
die "--version was not set" | ||
fi | ||
|
||
# Directories | ||
|
@@ -47,42 +46,32 @@ ROOT="$( cd "$THISDIR"/../../.. ; pwd -P )" | |
SRC="$ROOT/src" | ||
OUT="$ROOT/out" | ||
GCM_SRC="$SRC/shared/Git-Credential-Manager" | ||
GCM_UI_SRC="$SRC/shared/Git-Credential-Manager.UI.Avalonia" | ||
BITBUCKET_UI_SRC="$SRC/shared/Atlassian.Bitbucket.UI.Avalonia" | ||
GITHUB_UI_SRC="$SRC/shared/GitHub.UI.Avalonia" | ||
GITLAB_UI_SRC="$SRC/shared/GitLab.UI.Avalonia" | ||
DOTNET_TOOL="shared/DotnetTool" | ||
PROJ_OUT="$OUT/$DOTNET_TOOL" | ||
|
||
PACKAGE="$ROOT/nuget" | ||
CONFIGURATION="${CONFIGURATION:=Release}" | ||
CONFIGURATION="${CONFIGURATION:=Debug}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switched the default back to Thinking about it again, we should make these scripts easy to call locally in dev (where we'd want debug bits) since CI doesn't care how long command line args get 😁 |
||
|
||
# Build parameters | ||
FRAMEWORK=net6.0 | ||
|
||
# Outputs | ||
PAYLOAD="$PROJ_OUT/payload/$CONFIGURATION" | ||
SYMBOLOUT="$PROJ_OUT/payload.sym/$CONFIGURATION" | ||
|
||
# Cleanup payload directory | ||
if [ -d "$PAYLOAD" ]; then | ||
echo "Cleaning existing payload directory '$PAYLOAD'..." | ||
rm -rf "$PAYLOAD" | ||
fi | ||
|
||
# Cleanup symbol directory | ||
if [ -d "$SYMBOLOUT" ]; then | ||
echo "Cleaning existing symbols directory '$SYMBOLOUT'..." | ||
rm -rf "$SYMBOLOUT" | ||
fi | ||
|
||
# Cleanup package directory | ||
if [ -d "$PACKAGE" ]; then | ||
echo "Cleaning existing package directory '$PACKAGE'..." | ||
rm -rf "$PACKAGE" | ||
OUTDIR="$PROJ_OUT/nupkg/$CONFIGURATION" | ||
IMGOUT="$OUTDIR/images" | ||
PAYLOAD="$OUTDIR/payload" | ||
SYMBOLOUT="$OUTDIR/payload.sym" | ||
Comment on lines
+62
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Everything sits under |
||
|
||
# Cleanup output directory | ||
if [ -d "$OUTDIR" ]; then | ||
echo "Cleaning existing output directory '$OUTDIR'..." | ||
rm -rf "$OUTDIR" | ||
fi | ||
|
||
# Ensure directories exist | ||
mkdir -p "$PAYLOAD" "$SYMBOLOUT" "$PACKAGE" | ||
# Ensure output directories exist | ||
mkdir -p "$PAYLOAD" "$SYMBOLOUT" "$IMGOUT" | ||
|
||
if [ -z "$DOTNET_ROOT" ]; then | ||
DOTNET_ROOT="$(dirname $(which dotnet))" | ||
|
@@ -91,49 +80,61 @@ fi | |
# Publish core application executables | ||
echo "Publishing core application..." | ||
$DOTNET_ROOT/dotnet publish "$GCM_SRC" \ | ||
--configuration="$CONFIGURATION" \ | ||
--framework="$FRAMEWORK" \ | ||
--output="$(make_absolute "$PAYLOAD")" \ | ||
--configuration="$CONFIGURATION" \ | ||
--framework="$FRAMEWORK" \ | ||
--output="$(make_absolute "$PAYLOAD")" \ | ||
-p:UseAppHost=false || exit 1 | ||
|
||
echo "Publishing core UI helper..." | ||
$DOTNET_ROOT/dotnet publish "$GCM_UI_SRC" \ | ||
--configuration="$CONFIGURATION" \ | ||
--framework="$FRAMEWORK" \ | ||
--output="$(make_absolute "$PAYLOAD")" \ | ||
-p:UseAppHost=false || exit 1 | ||
|
||
echo "Publishing Bitbucket UI helper..." | ||
$DOTNET_ROOT/dotnet publish "$BITBUCKET_UI_SRC" \ | ||
--configuration="$CONFIGURATION" \ | ||
--framework="$FRAMEWORK" \ | ||
--output="$(make_absolute "$PAYLOAD")" \ | ||
--configuration="$CONFIGURATION" \ | ||
--framework="$FRAMEWORK" \ | ||
--output="$(make_absolute "$PAYLOAD")" \ | ||
-p:UseAppHost=false || exit 1 | ||
|
||
echo "Publishing GitHub UI helper..." | ||
$DOTNET_ROOT/dotnet publish "$GITHUB_UI_SRC" \ | ||
--configuration="$CONFIGURATION" \ | ||
--framework="$FRAMEWORK" \ | ||
--output="$(make_absolute "$PAYLOAD")" \ | ||
--configuration="$CONFIGURATION" \ | ||
--framework="$FRAMEWORK" \ | ||
--output="$(make_absolute "$PAYLOAD")" \ | ||
-p:UseAppHost=false || exit 1 | ||
|
||
echo "Publishing GitLab UI helper..." | ||
$DOTNET_ROOT/dotnet publish "$GITLAB_UI_SRC" \ | ||
--configuration="$CONFIGURATION" \ | ||
--framework="$FRAMEWORK" \ | ||
--output="$(make_absolute "$PAYLOAD")" \ | ||
--configuration="$CONFIGURATION" \ | ||
--framework="$FRAMEWORK" \ | ||
--output="$(make_absolute "$PAYLOAD")" \ | ||
-p:UseAppHost=false || exit 1 | ||
|
||
# Collect symbols | ||
echo "Collecting managed symbols..." | ||
mv "$PAYLOAD"/*.pdb "$SYMBOLOUT" || exit 1 | ||
|
||
# Copy DotnetToolSettings.xml file | ||
echo "Copying out package configuration files..." | ||
cp "$SRC/$DOTNET_TOOL/DotnetToolSettings.xml" "$PAYLOAD/" | ||
|
||
# Copy package icon image | ||
echo "Copying images..." | ||
cp "$SRC/$DOTNET_TOOL/icon.png" "$IMGOUT" || exit 1 | ||
|
||
echo "Build complete." | ||
|
||
##################################################################### | ||
# Pack dotnet tool | ||
##################################################################### | ||
echo "Creating dotnet tool package..." | ||
|
||
mkdir -p "$PACKAGE" || exit 1 | ||
echo "Laying out files..." | ||
cp -r "$SRC/$DOTNET_TOOL/DotnetToolSettings.xml" \ | ||
"$PAYLOAD/." \ | ||
"$PACKAGE/" | ||
Comment on lines
-133
to
-135
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to copy the output to another directory just to pack it. Instead we're now |
||
|
||
dotnet pack "$SRC/$DOTNET_TOOL/DotnetTool.csproj" /p:PackageVersion="$VERSION" /p:PublishDir="$PACKAGE/" | ||
dotnet pack "$SRC/$DOTNET_TOOL/DotnetTool.csproj" \ | ||
/p:Configuration="$CONFIGURATION" \ | ||
/p:PackageVersion="$VERSION" \ | ||
/p:PublishDir="$OUTDIR/" | ||
|
||
echo "Dotnet tool pack complete." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just prevents MSBuild from creating the empty/not used
net6.0
directory under$(OutputPath)/
.