Add Langauge Settings (#351)

This commit is contained in:
Chidozie Ononiwu 2020-07-28 20:18:32 -07:00 committed by GitHub
parent d9e39a0e6e
commit 61f36fd64d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,47 @@
$Language = "cpp"
$Lang = "net"
$PackageRepository = "CPP"
$packagePattern = "*.json"
$MetadataUri = ""
# Parse out package publishing information given a nupkg ZIP format.
function Get-cpp-PackageInfoFromPackageFile($pkg, $workingDirectory)
{
$packageInfo = Get-Content -Raw -Path $pkg | ConvertFrom-Json
$packageArtifactLocation = (Get-ItemProperty $pkg).Directory.FullName
$releaseNotes = ""
$readmeContent = ""
$pkgVersion = $packageInfo.version
$pkgName = $packageInfo.name
$changeLogLoc = @(Get-ChildItem -Path $packageArtifactLocation -Recurse -Include "CHANGELOG.md")[0]
if ($changeLogLoc)
{
$releaseNotes = Get-ChangeLogEntryAsString -ChangeLogLocation $changeLogLoc -VersionString $pkgVersion
}
$readmeContentLoc = @(Get-ChildItem -Path $packageArtifactLocation -Recurse -Include "README.md")[0]
if ($readmeContentLoc)
{
$readmeContent = Get-Content -Raw $readmeContentLoc
}
return New-Object PSObject -Property @{
PackageId $pkgName
PackageVersion $pkgVersion
# Artifact info is always considered deployable for now becasue it is not
# deployed anywhere. Dealing with duplicate tags happens downstream in
# CheckArtifactShaAgainstTagsList
Deployable = $true
ReleaseNotes = $releaseNotes
}
}
# Stage and Upload Docs to blob Storage
function Publish-cpp-GithubIODocs ()
{
$packageInfo = (Get-Content (Join-Path $DocLocation 'package-info.json') | ConvertFrom-Json)
Upload-Blobs -DocDir $DocLocation -PkgName $packageInfo.name -DocVersion $packageInfo.version
}