Changing the implementation from using shields.io to
using a local SVG file and doing replace. One less network hop.
This commit is contained in:
parent
4f2a8aeaf9
commit
ae78068481
5 changed files with 29 additions and 16 deletions
BIN
resources/images/.version_badge.svg.swp
Normal file
BIN
resources/images/.version_badge.svg.swp
Normal file
Binary file not shown.
20
resources/images/version_badge.svg
Normal file
20
resources/images/version_badge.svg
Normal file
|
@ -0,0 +1,20 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="102" height="20">
|
||||
<linearGradient id="b" x2="0" y2="100%">
|
||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1" />
|
||||
<stop offset="1" stop-opacity=".1" />
|
||||
</linearGradient>
|
||||
<mask id="a">
|
||||
<rect width="102" height="20" rx="3" fill="#fff" />
|
||||
</mask>
|
||||
<g mask="url(#a)">
|
||||
<path fill="#555" d="M0 0h52v20H0z" />
|
||||
<path fill="#007ec6" d="M52 0h50v20H52z" />
|
||||
<path fill="url(#b)" d="M0 0h102v20H0z" />
|
||||
</g>
|
||||
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
||||
<text x="26" y="15" fill="#010101" fill-opacity=".3">version</text>
|
||||
<text x="26" y="14">version</text>
|
||||
<text x="76" y="15" fill="#010101" fill-opacity=".3">ver_number</text>
|
||||
<text x="76" y="14">ver_number</text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 882 B |
BIN
scripts/package/.package.ps1.swp
Normal file
BIN
scripts/package/.package.ps1.swp
Normal file
Binary file not shown.
|
@ -15,11 +15,8 @@ _ "$RepoRoot\packaging\windows\generatemsi.ps1" @("$Stage2Dir")
|
|||
header "Generating NuGet packages"
|
||||
_ "$RepoRoot\packaging\nuget\package.ps1" @("$Stage2Dir\bin", "$env:VersionSuffix")
|
||||
|
||||
header "Downloading version badge"
|
||||
$VersionBadge = "$RepoRoot\artifacts\version_badge.svg"
|
||||
$r = Invoke-WebRequest -Uri "https://img.shields.io/badge/version-$env:DOTNET_CLI_VERSION-blue.svg" -OutFile $VersionBadge
|
||||
header "Generating version badge"
|
||||
$VersionBadge = "$RepoRoot\resources\images\version_badge.svg"
|
||||
(get-content $VersionBadge).replace("ver_number", "$env:DOTNET_CLI_VERSION") | set-content $VersionBadge
|
||||
|
||||
if ($r.StatusCode == 200)
|
||||
{
|
||||
& "$RepoRoot\publish\publish.ps1" "$RepoRoot\artifacts\version_badge.svg" -file $VersionBadge
|
||||
}
|
||||
& "$RepoRoot\publish\publish.ps1" -file $VersionBadge
|
||||
|
|
|
@ -20,7 +20,7 @@ if [ -z "$DOTNET_CLI_VERSION" ]; then
|
|||
DOTNET_CLI_VERSION=0.0.1-dev-t$TIMESTAMP
|
||||
fi
|
||||
|
||||
$VERSION_BADGE="$REPOROOT/artifacts/version_badge.svg"
|
||||
$VERSION_BADGE="$REPOROOT/resources/images/version_badge.svg"
|
||||
|
||||
header "Generating tarball"
|
||||
$DIR/package-dnvm.sh
|
||||
|
@ -28,13 +28,9 @@ $DIR/package-dnvm.sh
|
|||
header "Generating Native Installer"
|
||||
$DIR/package-native.sh
|
||||
|
||||
header "Downloading version badge"
|
||||
status_code=$(curl -w "%{http_code}" -s -o $VERSION_BADGE "https://img.shields.io/badge/version-$DOTNET_CLI_VERSION-blue.svg")
|
||||
header "Generating version badge"
|
||||
sed -i "s/ver_number/$DOTNET_CLI_VERSION/g" $VERSION_BADGE
|
||||
|
||||
if [ "$status_code" -eq "200"]; then
|
||||
header "Publishing version badge"
|
||||
$REPOROOT/scripts/publish/publish.sh $VERSION_BADGE
|
||||
else
|
||||
info "Downloading the badge failed - $status_code"
|
||||
fi
|
||||
header "Publishing version badge"
|
||||
$REPOROOT/scripts/publish/publish.sh $VERSION_BADGE
|
||||
|
||||
|
|
Loading…
Reference in a new issue