Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ stages:
parameters:
nuspecProperties: 'VersionSuffix=CI-$(Build.BuildNumber)'

- stage: Validate
- stage: ValidateInstall
dependsOn: []
jobs:
- template: build/validate-install-script.yml

- stage: ValidateInstallRelease
dependsOn: []
jobs:
- template: build/validate-install-release-script.yml
10 changes: 8 additions & 2 deletions .vsts-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ resources:
pool:
vmImage: windows-latest

trigger:
pr:
- master
- releases/*

variables:
BuildConfiguration: 'Debug'
Expand All @@ -21,7 +22,12 @@ stages:
parameters:
nuspecProperties: 'VersionSuffix=CI-$(Build.BuildNumber)'

- stage: Validate
- stage: ValidateInstall
dependsOn: []
jobs:
- template: build/validate-install-script.yml

- stage: ValidateInstallRelease
dependsOn: []
jobs:
- template: build/validate-install-release-script.yml
4 changes: 2 additions & 2 deletions Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CredentialProviderVersion>1.4.1</CredentialProviderVersion>
<CredentialProviderVersion>2.0.0</CredentialProviderVersion>
<VersionSuffix></VersionSuffix>
<TargetFrameworks>netcoreapp3.1;net461;net481;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net481;net6.0;net8.0</TargetFrameworks>
</PropertyGroup>
<!-- Remove with netcoreapp3.1; required for self-contained build -->
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'osx-arm64'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PropertyGroup>
<OutputPath>.\bin\$(Configuration)\</OutputPath>
<OutDir>$(OutputPath)</OutDir>
<PluginBinPath>..\CredentialProvider.Microsoft\bin\$(Configuration)\net461\</PluginBinPath>
<PluginBinPath>..\CredentialProvider.Microsoft\bin\$(Configuration)\net481\</PluginBinPath>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
<files>
<file src="ThirdPartyNotices.txt" target="\" />
<file src="EULA_Microsoft Visual Studio Team Services Credential Provider.docx" target="\" />
<file src="bin\$Configuration$\net461\**\*.*" target="\plugins\netfx\CredentialProvider.Microsoft" />
<file src="bin\$Configuration$\net481\**\*.*" target="\plugins\netfx48\CredentialProvider.Microsoft" />
<file src="bin\$Configuration$\netcoreapp3.1\publish\**\*.*" target="\plugins\netcore\CredentialProvider.Microsoft" />
<file src="bin\$Configuration$\net6.0\publish\**\*.*" target="\plugins\net6.0\CredentialProvider.Microsoft" />
<file src="bin\$Configuration$\net8.0\publish\**\*.*" target="\plugins\net8.0\CredentialProvider.Microsoft" />
</files>
Expand Down
74 changes: 1 addition & 73 deletions build/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ parameters:
nuspecProperties: ''

steps:
- task: UseDotNet@2
displayName: Install .NET Core 3.1 runtime
inputs:
packageType: runtime
version: 3.1.x

- task: UseDotNet@2
displayName: Use .NET 6 runtime
inputs:
Expand Down Expand Up @@ -143,74 +137,8 @@ steps:
archiveFile: '$(Build.ArtifactStagingDirectory)\$(BuildConfiguration)\Microsoft.Net8.NuGet.CredentialProvider.zip'
replaceExistingArchive: true

# Clean target folder and create netcore 3.1 and netfx releases
- script: dotnet publish CredentialProvider.Microsoft/CredentialProvider.Microsoft.csproj --no-build --framework netcoreapp3.1 --configuration $(BuildConfiguration) -p:${{ parameters.nuspecProperties }}
displayName: dotnet publish netcoreapp3.1

- task: CopyFiles@2
displayName: Copy netcore 3.1 files into tarball
inputs:
sourceFolder: '$(Build.SourcesDirectory)\CredentialProvider.Microsoft\bin\$(BuildConfiguration)\netcoreapp3.1\publish\'
contents: '**\*'
targetFolder: '$(Build.ArtifactStagingDirectory)\tarball\plugins\netcore\CredentialProvider.Microsoft\'
cleanTargetFolder: true

- task: CopyFiles@2
displayName: Copy license files into tarball
inputs:
contents: |
LICENSE
CredentialProvider.Microsoft\EULA_Microsoft Visual Studio Team Services Credential Provider.docx
CredentialProvider.Microsoft\ThirdPartyNotices.txt
targetFolder: '$(Build.ArtifactStagingDirectory)\tarball\'
flattenFolders: true

- task: ArchiveFiles@2
displayName: Create netcore 3.1 tarball
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)\tarball\'
includeRootFolder: false
archiveType: 'tar'
tarCompression: 'gz'
archiveFile: '$(Build.ArtifactStagingDirectory)\$(BuildConfiguration)\Microsoft.NetCore3.NuGet.CredentialProvider.tar.gz'
replaceExistingArchive: true

# NOTE: Changing the name of the zip will break things. Please don't do it.
- task: ArchiveFiles@2
displayName: Create netcore 3.1 zip
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)\tarball\'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)\$(BuildConfiguration)\Microsoft.NetCore3.NuGet.CredentialProvider.zip'
replaceExistingArchive: true

- task: CopyFiles@2
displayName: Copy netfx files into tarball
inputs:
sourceFolder: '$(Build.SourcesDirectory)\CredentialProvider.Microsoft\bin\$(BuildConfiguration)\net461\'
contents: '**\*'
targetFolder: '$(Build.ArtifactStagingDirectory)\tarball\plugins\netfx\CredentialProvider.Microsoft\'

- task: ArchiveFiles@2
displayName: Create netfx tarball
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)\tarball\'
includeRootFolder: false
archiveType: 'tar'
tarCompression: 'gz'
archiveFile: '$(Build.ArtifactStagingDirectory)\$(BuildConfiguration)\Microsoft.NuGet.CredentialProvider.tar.gz'
replaceExistingArchive: true

# Clean target folder and create netfx releases
# NOTE: Changing the name of the zip will break things. Please don't do it.
- task: ArchiveFiles@2
displayName: Create zip
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)\tarball\'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)\$(BuildConfiguration)\Microsoft.NuGet.CredentialProvider.zip'
replaceExistingArchive: true

- task: CopyFiles@2
displayName: Copy netfx 4.8.1 files into tarball
Expand Down
48 changes: 48 additions & 0 deletions build/validate-install-release-script-bash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
parameters:
- name: repo
type: string
- name: scriptEnvVariables
type: string
- name: expectedCredentialProviderVersion
type: string
- name: releaseVersion
type: string
default: 'latest'

steps:
- checkout: ${{ parameters.repo }}
- bash: |
${{ parameters.scriptEnvVariables }}

RELEASE_VERSION="${{ parameters.releaseVersion }}"
if [ "$RELEASE_VERSION" = "latest" ]; then
./helpers/installcredproviderrelease.sh -Force >> ./output.log 2>&1
else
export AZURE_ARTIFACTS_CREDENTIAL_PROVIDER_VERSION="$RELEASE_VERSION"
./helpers/installcredproviderrelease.sh -Force >> ./output.log 2>&1
fi

cat ./output.log

# Check if expected credential provider version was found in output
if ! grep "${{ parameters.expectedCredentialProviderVersion }}" ./output.log; then
echo "Expected credential provider not found in output"
exit 1
fi

# Verify the credential provider directory was created
if [ ! -d "$HOME/.nuget/plugins/netcore/CredentialProvider.Microsoft" ]; then
echo "Credential provider plugin directory not found at: $HOME/.nuget/plugins/netcore/CredentialProvider.Microsoft"
exit 1
fi

echo "Credential provider installed successfully via release script"
workingDirectory: $(Build.SourcesDirectory)
displayName: Validate Install Release Script
- bash: |
if grep $'\r' ./helpers/installcredproviderrelease.sh; then
echo "CRLF line ending found"
exit 1
fi
workingDirectory: $(Build.SourcesDirectory)
displayName: Check Line Endings
43 changes: 43 additions & 0 deletions build/validate-install-release-script-powershell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
parameters:
- name: repo
type: string
- name: scriptInputs
type: string
- name: expectedCredentialProviderVersion
type: string
- name: releaseVersion
type: string
default: 'latest'

steps:
- checkout: ${{ parameters.repo }}
- task: PowerShell@2
displayName: Validate Install Release Script
inputs:
targetType: 'inline'
script: |
$releaseVersion = "${{ parameters.releaseVersion }}"
if ($releaseVersion -eq "latest") {
./helpers/installcredproviderrelease.ps1 ${{ parameters.scriptInputs }} -Force 6>> ./output.log
} else {
./helpers/installcredproviderrelease.ps1 -Version $releaseVersion ${{ parameters.scriptInputs }} -Force 6>> ./output.log
}

cat ./output.log

# Check if expected credential provider version was installed
if( (Select-String -Path .\output.log -Pattern ${{ parameters.expectedCredentialProviderVersion }}) -eq $null) {
echo "Expected credential provider file not found in output."
exit 1
}

# Verify the credential provider was actually installed
$pluginPath = "$env:USERPROFILE\.nuget\plugins\netcore\CredentialProvider.Microsoft"
if (!(Test-Path $pluginPath)) {
echo "Credential provider plugin directory not found at: $pluginPath"
exit 1
}

echo "Credential provider installed successfully via release script"
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: false
Loading