11$Language = " python"
22$LanguageDisplayName = " Python"
33$PackageRepository = " PyPI"
4- $packagePattern = " *.zip "
4+ $packagePattern = " *.tar.gz "
55$MetadataUri = " https://raw.githubusercontent.com/Azure/azure-sdk/main/_data/releases/latest/python-packages.csv"
66$BlobStorageUrl = " https://azuresdkdocs.blob.core.windows.net/%24web?restype=container&comp=list&prefix=python%2F&delimiter=%2F"
77$GithubUri = " https://github.com/Azure/azure-sdk-for-python"
@@ -86,7 +86,7 @@ function IsPythonPackageVersionPublished($pkgId, $pkgVersion)
8686 }
8787}
8888
89- # Parse out package publishing information given a python sdist of ZIP format.
89+ # Parse out package publishing information given a python sdist of tar.gz format.
9090function Get-python-PackageInfoFromPackageFile ($pkg , $workingDirectory )
9191{
9292 $pkg.Basename -match $SDIST_PACKAGE_REGEX | Out-Null
@@ -101,7 +101,8 @@ function Get-python-PackageInfoFromPackageFile ($pkg, $workingDirectory)
101101 $readmeContent = " "
102102
103103 New-Item - ItemType Directory - Force - Path $workFolder
104- Expand-Archive - Path $pkg - DestinationPath $workFolder
104+ Write-Host " tar -zxvf $pkg -C $workFolder "
105+ tar - zxvf $pkg - C $workFolder
105106
106107 $changeLogLoc = @ (Get-ChildItem - Path $workFolder - Recurse - Include " CHANGELOG.md" )[0 ]
107108 if ($changeLogLoc ) {
@@ -130,16 +131,26 @@ function Get-python-PackageInfoFromPackageFile ($pkg, $workingDirectory)
130131# Stage and Upload Docs to blob Storage
131132function Publish-python-GithubIODocs ($DocLocation , $PublicArtifactLocation )
132133{
133- $PublishedDocs = Get-ChildItem " $DocLocation " | Where-Object - FilterScript {$_.Name.EndsWith (" .zip " )}
134+ $PublishedDocs = Get-ChildItem " $DocLocation " | Where-Object - FilterScript {$_.Name.EndsWith (" .tar.gz " )}
134135
135136 foreach ($Item in $PublishedDocs )
136137 {
137- $PkgName = $Item.BaseName
138+ $PkgName = $Item.BaseName.Replace ( " .tar " , " " )
138139 $ZippedDocumentationPath = Join-Path - Path $DocLocation - ChildPath $Item.Name
139140 $UnzippedDocumentationPath = Join-Path - Path $DocLocation - ChildPath $PkgName
140141 $VersionFileLocation = Join-Path - Path $UnzippedDocumentationPath - ChildPath " version.txt"
141142
142- Expand-Archive - Force - Path $ZippedDocumentationPath - DestinationPath $UnzippedDocumentationPath
143+ if (! (Test-Path $UnzippedDocumentationPath )) {
144+ New-Item - Path $UnzippedDocumentationPath - ItemType Directory
145+ }
146+
147+ Write-Host " tar -zxvf $ZippedDocumentationPath -C $UnzippedDocumentationPath "
148+ tar - zxvf $ZippedDocumentationPath - C $UnzippedDocumentationPath
149+
150+ if ($LASTEXITCODE -ne 0 ) {
151+ Write-Error " tar failed with exit code $LASTEXITCODE ."
152+ exit $LASTEXITCODE
153+ }
143154
144155 $Version = $ (Get-Content $VersionFileLocation ).Trim()
145156
0 commit comments