Skip to content
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

Update Install Script to enable Self-Contained Download #540

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
11 changes: 9 additions & 2 deletions helpers/installcredprovider.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ param(
# install the .NET 6 cred provider instead of NetCore3.1
[switch]$InstallNet6 = $true,
# install the .NET 8 cred provider instead of NetCore3.1
[switch]$InstallNet8
[switch]$InstallNet8,
# install the self-contained cred provider for the specified platform.
[string]$Platform
embetten marked this conversation as resolved.
Show resolved Hide resolved
)

$script:ErrorActionPreference='Stop'
Expand Down Expand Up @@ -103,6 +105,11 @@ if (!$releaseId) {
$releaseUrl = [System.IO.Path]::Combine($releaseUrlBase, $releaseId)
$releaseUrl = $releaseUrl.Replace("\","/")

$releaseRIdPart = ""
embetten marked this conversation as resolved.
Show resolved Hide resolved
if (![string]::IsNullOrEmpty($Platform)) {
$releaseRIdPart = $Platform + "."
}

$zipFile = "Microsoft.NetCore3.NuGet.CredentialProvider.zip"
if ($Version.StartsWith("0.")) {
# versions lower than 1.0.0 installed NetCore2 zip
Expand All @@ -112,7 +119,7 @@ if ($InstallNet6 -eq $True) {
$zipFile = "Microsoft.Net6.NuGet.CredentialProvider.zip"
}
if ($InstallNet8 -eq $True) {
$zipFile = "Microsoft.Net8.NuGet.CredentialProvider.zip"
$zipFile = "Microsoft.Net8." + $releaseRIdPart + "NuGet.CredentialProvider.zip"
embetten marked this conversation as resolved.
Show resolved Hide resolved
}
if ($AddNetfx -eq $True) {
$zipFile = "Microsoft.NuGet.CredentialProvider.zip"
Expand Down
11 changes: 9 additions & 2 deletions helpers/installcredprovider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ if [ -z ${USE_NET6_ARTIFACTS_CREDENTIAL_PROVIDER} ] || [ ${USE_NET6_ARTIFACTS_CR
esac
# Don't attempt to install .NET 8 without a set variable.
elif [ ! -z ${USE_NET8_ARTIFACTS_CREDENTIAL_PROVIDER} ] && [ ${USE_NET8_ARTIFACTS_CREDENTIAL_PROVIDER} != "false" ]; then
FILE="Microsoft.Net8.NuGet.CredentialProvider.tar.gz"
# Self-contained versions are available in latest versions of the .NET 8 credprovider.
# To install a release with a specific runtime version set the `USE_RID_ARTIFACTS_CREDENTIAL_PROVIDER` enviornment variable.
embetten marked this conversation as resolved.
Show resolved Hide resolved
# Otherwise default to the full zip file.
RID=""
if [ ! -z ${USE_RID_ARTIFACTS_CREDENTIAL_PROVIDER} ]; then
RID=".${USE_RID_ARTIFACTS_CREDENTIAL_PROVIDER}"
fi
FILE="Microsoft.Net8$RID.NuGet.CredentialProvider.tar.gz"

# throw if version starts < 1.3.0. (net8 not supported)
case ${AZURE_ARTIFACTS_CREDENTIAL_PROVIDER_VERSION} in
Expand Down Expand Up @@ -68,4 +75,4 @@ if ! curl -H "Accept: application/octet-stream" \
exit 1
fi

echo "INFO: credential provider netcore plugin extracted to $HOME/.nuget/"
echo "INFO: credential provider netcore plugin extracted to $HOME/.nuget/"