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
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…
Add table
Add a link
Reference in a new issue