diff --git a/.azure-pipelines/code-gen.yml b/.azure-pipelines/code-gen.yml deleted file mode 100644 index b00c6008fe8f..000000000000 --- a/.azure-pipelines/code-gen.yml +++ /dev/null @@ -1,109 +0,0 @@ -# Multi-job configuration must be converted to matrix strategy: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#multi-job-configuration -parameters: -- name: TargetBranch - displayName: Branch this module will generated to - type: string - default: main -- name: ServiceName - displayName: Service to generate - type: string - default: Databricks - -resources: - repositories: - - repository: self - type: git - ref: refs/heads/generation -jobs: -- job: Job_1 - displayName: "Service: ${{ parameters.ServiceName }}" - timeoutInMinutes: 90 - pool: pool-windows-2019 - steps: - - checkout: self - - template: util/get-github-pat-steps.yml - - task: NodeTool@0 - displayName: Use Node 14.15.5 - inputs: - versionSpec: 14.15.5 - - task: Npm@1 - displayName: Install autorest - inputs: - command: custom - verbose: false - customCommand: install -g autorest@latest - - task: PowerShell@2 - displayName: Generate - inputs: - targetType: inline - script: >- - $subModuleFolders = Get-ChildItem -Directory -Filter *.Autorest; - - if ($subModuleFolders -eq $null) { - autorest --max-memory-size=8192; - } else { - $subModuleFolders | foreach-object { cd $_.FullName; autorest --max-memory-size=8192}; - } - workingDirectory: src/${{ parameters.ServiceName }} - - - task: PowerShell@2 - displayName: Build - inputs: - targetType: inline - script: >- - $subModuleFolders = Get-ChildItem -Directory -Filter *.Autorest; - - if ($subModuleFolders -eq $null) { - ./build-module.ps1; - } else { - $subModuleFolders | foreach-object { cd $_.FullName; ./build-module.ps1; cd ..} - } - - mkdir ../../artifacts/src/${{ parameters.ServiceName }}; - - cp -r ./* ../../artifacts/src/${{ parameters.ServiceName }}; - pwsh: true - workingDirectory: src/${{ parameters.ServiceName }} - - task: PowerShell@2 - displayName: Checkout main branch - inputs: - targetType: inline - script: >- - if ((Test-Path src/${{ parameters.ServiceName }})) - { - rm -r src/${{ parameters.ServiceName }}; - } - git checkout src/${{ parameters.ServiceName }}; - git checkout -b codegen/${{ parameters.ServiceName }} origin/${{ parameters.TargetBranch }}; - - task: PowerShell@2 - displayName: 'Create codegen/${{ parameters.ServiceName }} branch' - inputs: - targetType: 'inline' - script: | - #Uninstall-Module -Name PackageManagement -AllVersions; - Install-Module -Name PowerShellGet -RequiredVersion 2.2.3 -Force; - Install-Module -Name platyPS -RequiredVersion 0.14.2 -Force; - Install-Module -Name Az.Accounts -Force; - Import-Module .\tools\Gen2Master\MoveFromGeneration2Master.ps1; - Move-Generation2Master -SourcePath .\artifacts\src\${{ parameters.ServiceName }} -DestPath .\src\${{ parameters.ServiceName }}; - git config user.email "65331932+azure-powershell-bot@users.noreply.github.com"; - git config user.name "azure-powershell-bot"; - git add src; - git add tools/CreateMappings_rules.json; - git commit -m "Move ${{ parameters.ServiceName }} to ${{ parameters.TargetBranch }}"; - git remote set-url origin https://azure-powershell-bot:$(GithubToken)@github.com/Azure/azure-powershell.git; - git push origin codegen/${{ parameters.ServiceName }} --force; - arguments: '-RequiredPsVersion $(PSVersion)' - pwsh: true - - pwsh: | - $SourceBranch = "$(Build.SourceBranch)" - $SourceBranch = $SourceBranch.Replace("refs/heads/", "") - $Title = "Migrate ${{ parameters.ServiceName }} from $SourceBranch to ${{ parameters.TargetBranch }}" - $HeadBranch = "codegen/${{ parameters.ServiceName }}" - $BaseBranch = "${{ parameters.TargetBranch }}" - $Description = "Migrate ${{ parameters.ServiceName }} from $SourceBranch to ${{ parameters.TargetBranch }} - The last commit of src/${{ parameters.ServiceName }} in $SourceBranch is: - $(git log -1 origin/$SourceBranch -- ./src/${{ parameters.ServiceName }}) - " - ./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $(GithubToken) -Description $Description - displayName: Create PR to main branch diff --git a/.azure-pipelines/code-oob.yml b/.azure-pipelines/code-oob.yml deleted file mode 100644 index 985ffc8c1046..000000000000 --- a/.azure-pipelines/code-oob.yml +++ /dev/null @@ -1,181 +0,0 @@ -parameters: -- name: ServiceName - displayName: OOB release Service - type: string - default: Databricks -- name: Preview - displayName: Is preview version? (version is "x.y.z-preview" or major version is 0) - type: boolean - default: false -variables: - BumpUpBranch: none -stages: -- stage: OOBRelease - displayName: OOBRelease - jobs: - - job: BumpUpVersion - timeoutInMinutes: 180 - pool: pool-windows-2019 - variables: - NeedBumpUp: true - steps: - - task: DotNetCoreCLI@2 - displayName: Build - inputs: - command: custom - custom: msbuild - arguments: 'build.proj "/t:Clean;Build" /p:Configuration=Release;TargetModule=${{ parameters.ServiceName }}' - - pwsh: | - .\tools\RunVersionController.ps1 -ModuleName "Az.${{ parameters.ServiceName }}" - displayName: 'Bump up version' - - task: PowerShell@2 - displayName: get changelog info - name: outputinfo - inputs: - targetType: 'inline' - script: | - $readme = Get-ChildItem -Path "./src/${{ parameters.ServiceName }}" -name ChangeLog.md -Recurse - $mdContent = Get-Content -Path "src/${{ parameters.ServiceName }}/$readme" -Raw - $pattern = '(?s)## Version (\d+\.\d+\.\d)+[\s\S]*?\n(.*?)(?=\n## Version \d+\.\d+\.\d+|$)' - $matches = [regex]::Match($mdcontent, $pattern) - $NeedBumpUp = $true - $BaseBranch = "$(BranchPrefix)/${{ parameters.ServiceName }}" - if ($matches.Success) { - $versionNumber = $matches.Groups[1].Value - $versionChanges = $matches.Groups[2].Value.Trim() - } - if ($${{ parameters.Preview }} -and ([version]$versionNumber -ge [version]"1.0.0")) { - $versionNumber += "-preview" - echo "##vso[task.setvariable variable=NeedBumpUp]false" - $NeedBumpUp = $false - $BaseBranch = "$(Build.SourceBranch)" - $BaseBranch = $BaseBranch.Replace("refs/heads/", "") - } - $jsonData = @{ - ModuleName = "${{ parameters.ServiceName }}" - VersionNumber = "$versionNumber" - VersionChanges = "$versionChanges" - IsPreview = “${{ parameters.Preview }}“ - BaseBranch = "$BaseBranch" - } - $jsonString = $jsonData | ConvertTo-Json - $folderPath = "OOB" - $fileName = "VersionInfo.json" - New-Item -ItemType Directory -Force -Path $folderPath | Out-Null - $filePath = Join-Path -Path $folderPath -ChildPath $fileName - $jsonString | Out-File -FilePath $filePath - $content = @" - The OOB build is ready. Please give it a test and let us know if it's OK to publish. - - How to install: - - Install the Az.Tools.Installer module. - ``````powershell - Install-Module -Name Az.Tools.Installer -Repository PSGallery - `````` - - Install the latest Az.Accounts module unless the OOB build requires a specific version. - ``````powershell - Install-Module Az.Accounts -Repository PSGallery - `````` - - Use Az.Tools.Installer to install the OOB build. - ``````powershell - Install-AzModule -Path $(BlobUrl)/Az.${{ parameters.ServiceName }}.$versionNumber.nupkg - `````` - - "@ - $readmePath = "OOB/README.md" - $content | Out-File -FilePath $readmePath - - if ($NeedBumpUp) { - echo "##vso[task.setvariable variable=BumpUpBranch;isOutput=true]$(BranchPrefix)/${{ parameters.ServiceName }}" - - } else { - echo "##vso[task.setvariable variable=BumpUpBranch;isOutput=true]none" - } - - task: AzurePowerShell@5 - inputs: - azureSubscription: '$(AzureSubscription)' - ScriptType: 'InlineScript' - azurePowerShellVersion: 'LatestVersion' - inline: | - Set-AzContext -Tenant $(TenantId) -SubscriptionId $(SubscriptionId) - $Token = Get-AzKeyVaultSecret -VaultName $(KeyVaultName) -Name $(KeyVaultAccount) -AsPlainText - git config user.email "$(GithubEmail)" - git config user.name "$(GithubUsername)" - git checkout -b $(BranchPrefix)/${{ parameters.ServiceName }} - git add -A ':!OOB' - if ($${{ parameters.Preview }}) { - git reset -- ./tools/Tools.Common/SerializedCmdlets/Az.${{ parameters.ServiceName }}.json - } - git commit -m "Bump up version for ${{ parameters.ServiceName }}" - git remote set-url origin https://azure-powershell-bot:$Token@github.com/Azure/azure-powershell.git; - git push origin $(BranchPrefix)/${{ parameters.ServiceName }} --force; - $Title = "${{ parameters.ServiceName }} OOB Release" - $HeadBranch = "$(BranchPrefix)/${{ parameters.ServiceName }}" - $BaseBranch = "$(Build.SourceBranch)" - $BaseBranch = $BaseBranch.Replace("refs/heads/", "") - $Description = "${{ parameters.ServiceName }} OOB Release" - ./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $Token -Description $Description -Draft $true - displayName: Create PR to main branch - condition: and(succeeded(), eq(variables['NeedBumpUp'], 'true')) - - - task: PowerShell@2 - displayName: publish oob tools - inputs: - targetType: 'inline' - script: | - Copy-Item .\tools\ModulePublisher.psd1 -Destination OOB - Copy-Item .\tools\ModulePublisher.psm1 -Destination OOB - Copy-Item .\tools\NuGet.exe -Destination OOB - - - task: ManifestGeneratorTask@0 - displayName: 'Generation Task' - inputs: - PackageName: 'Azure PowerShell - ${{ parameters.ServiceName }}' - BuildDropPath: OOB - - - task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: OOB - ArtifactName: OOB -- stage: Codesign - variables: - BumpUpBranch: $[stageDependencies.OOBRelease.BumpUpVersion.outputs['outputinfo.BumpUpBranch']] - dependsOn: OOBRelease - jobs: - - template: ./code-sign.yml - parameters: - OOBBranch: $(BumpUpBranch) - TargetModule: ${{ parameters.ServiceName }} - BuildInstaller: false - - job: PulishForTest - dependsOn: Release - steps: - - task: DownloadBuildArtifacts@1 - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'OOB' - downloadPath: '$(System.ArtifactsDirectory)' - - task: DownloadBuildArtifacts@1 - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'artifacts' - downloadPath: '$(System.ArtifactsDirectory)' - - task: AzurePowerShell@5 - displayName: 'Push packages to storage account' - inputs: - azureSubscription: '$(AzureSubscription)' - ScriptType: InlineScript - azurePowerShellVersion: LatestVersion - pwsh: true - Inline: | - $jsonFilePath = "$(System.ArtifactsDirectory)/OOB/VersionInfo.json" - $jsonContent = Get-Content -Path $jsonFilePath -Raw - $jsonObject = $jsonContent | ConvertFrom-Json - $versionNumber = $jsonObject.VersionNumber - $versionChanges = $jsonObject.VersionChanges - $moduleName = $jsonObject.ModuleName - $context = New-AzStorageContext -StorageAccountName "$(TestStorageAccountName)" - $package = Get-Item "$(System.ArtifactsDirectory)/artifacts/Az.$moduleName.$versionNumber.nupkg" - $package | Set-AzStorageBlobContent -Container "public" -Context $context -Force diff --git a/.azure-pipelines/code-sign.yml b/.azure-pipelines/code-sign.yml deleted file mode 100644 index 209b5fba6a57..000000000000 --- a/.azure-pipelines/code-sign.yml +++ /dev/null @@ -1,500 +0,0 @@ -parameters: -- name: OOBBranch - displayName: Branch for OOB pipeline - type: string - default: 'none' -- name: TargetModule - displayName: Build Module List(Split by ':') - type: string - default: 'none' -- name: BuildInstaller - displayName: Build Installer - type: boolean - default: true -jobs: -- job: Release - timeoutInMinutes: 180 - pool: - name: $(AgentPool) - demands: npm - variables: - LocalRepoName: 'LocalRepo' - steps: - - template: util/get-github-pat-steps.yml - - task: PowerShell@2 - displayName: checkout OOBbranch - inputs: - targetType: 'inline' - script: | - if ('${{ parameters.OOBBranch }}' -ne 'none') { - git remote set-url origin https://azure-powershell-bot:$GithubToken@github.com/Azure/azure-powershell.git; - git fetch origin - git checkout -b ${{ parameters.OOBBranch }} origin/${{ parameters.OOBBranch }} - } - - pwsh: 'Install-Module platyPS -Force -Confirm:$false -Scope CurrentUser' - displayName: 'Install platyPS' - - - pwsh: 'Install-Module PowerShellGet -Force -Confirm:$false -Scope CurrentUser -SkipPublisherCheck' - displayName: 'Install PowerShellGet [v2.1.3 has a Publish-Module bug]' - - - task: DotNetCoreCLI@2 - displayName: Build For Target Module - condition: ne('${{ parameters.TargetModule }}', 'none') - inputs: - command: custom - custom: msbuild - arguments: 'build.proj /t:"Build;CopyAboutTopics;GenerateHelp" /p:"Configuration=Release;GenerateDocumentationFile=true;TargetModule=${{ parameters.TargetModule }}"' - - task: DotNetCoreCLI@2 - displayName: Build For Modified Modules - condition: eq('${{ parameters.TargetModule }}', 'none') - inputs: - command: custom - custom: msbuild - arguments: 'build.proj /t:"Build;CopyAboutTopics;GenerateHelp" /p:"Configuration=Release;GenerateDocumentationFile=true;ModifiedModuleBuild=true"' - - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: 'Manifest Generator ' - inputs: - BuildDropPath: artifacts - PackageName: 'Azure PowerShell' - PackageVersion: 7.2 - enabled: false - - - pwsh: | - # Delete PowerShell Runtime Files - Get-ChildItem -Path $Env:RepoArtifacts/$Env:Configuration -Recurse -Include 'runtimes' | Remove-Item -Recurse -Force - # Copy ShortCut to be Signed - Copy-Item .\tools\Az\Az.psm1 -Destination $Env:RepoArtifacts/$Env:Configuration - Copy-Item .\tools\AzPreview\AzPreview.psm1 -Destination $Env:RepoArtifacts/$Env:Configuration - Copy-Item .\tools\Installer\InstallModule.ps1 -Destination $Env:RepoArtifacts/$Env:Configuration - Copy-Item .\setup\InstallerChecks.dll -Destination $Env:RepoArtifacts/ - Copy-Item .\setup\Microsoft.Deployment.WindowsInstaller.dll -Destination $Env:RepoArtifacts/ - displayName: 'Before Signing' - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@4 - displayName: 'Sign Dll [Authenticode + Strong Name]' - inputs: - ConnectedServiceName: 'ESRP Signing Service' - FolderPath: artifacts - Pattern: | - Release/**/Microsoft*Azure*PowerShell*Cmdlets*.dll - Release/**/Microsoft.Azure.PowerShell.*.Sdk.dll - Release/**/Az.*.private.dll - Release/**/Microsoft.Azure.PowerShell.Authentication.dll - Release/**/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll - Release/**/Microsoft.Azure.PowerShell.Authenticators.dll - Release/**/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll - Release/**/Microsoft.Azure.PowerShell.AssemblyLoading.dll - Release/**/Microsoft.Azure.Commands.*.AlcWrapper.dll - InstallerChecks.dll - !Release/**/Microsoft*Azure*PowerShell*Cmdlets*.Test.dll - UseMinimatch: true - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "KeyCode": "CP-233863-SN", - "OperationCode": "StrongNameSign", - "Parameters": {}, - "ToolName": "sign", - "ToolVersion": "1.0" - }, - { - "KeyCode": "CP-233863-SN", - "OperationCode": "StrongNameVerify", - "Parameters": {}, - "ToolName": "sign", - "ToolVersion": "1.0" - }, - { - "KeyCode": "CP-230012", - "OperationCode": "SigntoolSign", - "Parameters": { - "OpusName": "Microsoft", - "OpusInfo": "http://www.microsoft.com", - "FileDigest": "/fd \"SHA256\"", - "PageHash": "/NPH", - "TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - }, - "ToolName": "sign", - "ToolVersion": "1.0" - }, - { - "KeyCode": "CP-230012", - "OperationCode": "SigntoolVerify", - "Parameters": {}, - "ToolName": "sign", - "ToolVersion": "1.0" - } - ] - - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@4 - displayName: 'Sign Scripts [Authenticode]' - inputs: - ConnectedServiceName: 'ESRP Signing Service' - FolderPath: artifacts - Pattern: | - Release/**/*.ps1 - Release/**/*.psm1 - Release/**/*.ps1xml - Release/**/*.js - UseMinimatch: true - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "KeyCode": "CP-230012", - "OperationCode": "SigntoolSign", - "Parameters": { - "OpusName": "Microsoft", - "OpusInfo": "http://www.microsoft.com", - "FileDigest": "/fd \"SHA256\"", - "PageHash": "/NPH", - "TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - }, - "ToolName": "sign", - "ToolVersion": "1.0" - }, - { - "KeyCode": "CP-230012", - "OperationCode": "SigntoolVerify", - "Parameters": {}, - "ToolName": "sign", - "ToolVersion": "1.0" - } - ] - - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@4 - displayName: 'Sign 3rd Party [Strong Name]' - inputs: - ConnectedServiceName: 'ESRP Signing Service' - FolderPath: artifacts - Pattern: 'Release/**/FuzzySharp.dll' - UseMinimatch: true - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "KeyCode": "CP-233863-SN", - "OperationCode": "StrongNameSign", - "Parameters": {}, - "ToolName": "sign", - "ToolVersion": "1.0" - }, - { - "KeyCode": "CP-233863-SN", - "OperationCode": "StrongNameVerify", - "Parameters": {}, - "ToolName": "sign", - "ToolVersion": "1.0" - } - ] - - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@4 - displayName: 'Sign 3rd Party [Authenticode]' - inputs: - ConnectedServiceName: 'ESRP Signing Service' - FolderPath: artifacts - Pattern: | - Release/**/*AutoMapper*.dll - Release/**/*TimeZoneConverter*.dll - Release/**/*YamlDotNet*.dll - Release/**/*Newtonsoft.Json*.dll - Release/**/*BouncyCastle.Crypto*.dll - Release/**/FuzzySharp.dll - Microsoft.Deployment.WindowsInstaller.dll - UseMinimatch: true - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "KeyCode": "CP-231522", - "OperationCode": "SigntoolSign", - "Parameters": { - "OpusName": "Microsoft", - "OpusInfo": "http://www.microsoft.com", - "FileDigest": "/fd \"SHA256\"", - "PageHash": "/NPH", - "Append" : "/as", - "TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - }, - "ToolName": "sign", - "ToolVersion": "1.0" - }, - { - "KeyCode": "CP-231522", - "OperationCode": "SigntoolVerify", - "Parameters": {}, - "ToolName": "sign", - "ToolVersion": "1.0" - } - ] - - - pwsh: | - # Check Signature - $Env:Path += ";C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools" - # Do not check psd1 - $Env:CheckPsd1 = "False" - ./tools/CheckSignature.ps1 -CustomPath $Env:RepoArtifacts/$Env:Configuration - # Copy files back after signing - Copy-Item $Env:RepoArtifacts/$Env:Configuration/Az.psm1 -Destination ./tools/Az - Copy-Item $Env:RepoArtifacts/$Env:Configuration/AzPreview.psm1 -Destination ./tools/AzPreview - Copy-Item $Env:RepoArtifacts/InstallerChecks.dll -Destination .\setup - Copy-Item $Env:RepoArtifacts/Microsoft.Deployment.WindowsInstaller.dll -Destination .\setup - displayName: 'After Signing' - env: - CheckPsd1: True - - - task: securedevelopmentteam.vss-secure-development-tools.build-task-codesignvalidation.CodeSign@1 - displayName: 'Run Codesign Validation' - inputs: - Path: artifacts/Release - - - script: '"%wix%\sdk\MakeSfxCA.exe" "%cd%\setup\InstallerChecks.CA.dll" "%cd%\setup\SfxCA.dll" "%cd%\setup\InstallerChecks.dll" "%cd%\setup\Microsoft.Deployment.WindowsInstaller.dll;%cd%\setup\InstallerChecks\InstallerChecks\CustomAction.config"' - displayName: 'Generate InstallerCheck.CA.dll' - - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@4 - displayName: 'Sign Installercheck.CA.dll [Authenticode]' - inputs: - ConnectedServiceName: 'ESRP Signing Service' - FolderPath: setup - Pattern: InstallerChecks.CA.dll - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "KeyCode": "CP-231522", - "OperationCode": "SigntoolSign", - "Parameters": { - "OpusName": "Microsoft", - "OpusInfo": "http://www.microsoft.com", - "FileDigest": "/fd \"SHA256\"", - "PageHash": "/NPH", - "Append" : "/as", - "TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - }, - "ToolName": "sign", - "ToolVersion": "1.0" - }, - { - "KeyCode": "CP-231522", - "OperationCode": "SigntoolVerify", - "Parameters": {}, - "ToolName": "sign", - "ToolVersion": "1.0" - } - ] - - - pwsh: './tools/CleanupBuild.ps1 -BuildConfig Release -GenerateDocumentationFile true' - displayName: 'Cleanup Build' - enabled: false - - - task: PublishBuildArtifacts@1 - displayName: 'Save artifacts before cleanup' - inputs: - PathtoPublish: artifacts - ArtifactName: 'docs-artifacts' - condition: succeededOrFailed() - - - task: DotNetCoreCLI@2 - displayName: Publish - inputs: - command: custom - custom: msbuild - arguments: 'build.proj /t:Publish /p:Configuration=Release;NuGetKey=$(NuGetKey);GenerateDocumentationFile=false;TargetModule=${{ parameters.TargetModule }}' - - - pwsh: | - #this task won't be triggered unless $AzureStack was set to true - #move Az.Accounts.*.nupkg to a temporary folder "non_release_artifacts" - New-Item -Path "artifacts" -Name "non_release_artifacts" -ItemType "directory" - - # $accounts = Get-ChildItem -Path "artifacts" -Filter "*Az.Accounts.*.nupkg" - # $iothub= Get-ChildItem -Path "artifacts" -Filter "*Az.IotHub.*.nupkg" - $eventhub= Get-ChildItem -Path "artifacts" -Filter "*Az.EventHub.*.nupkg" - $databoxedge= Get-ChildItem -Path "artifacts" -Filter "*Az.DataBoxEdge.*.nupkg" - $monitor= Get-ChildItem -Path "artifacts" -Filter "*Az.Monitor.*.nupkg" - - # Move-Item -Path $accounts.FullName -Destination "artifacts\non_release_artifacts" - # Move-Item -Path $iothub.FullName -Destination "artifacts\non_release_artifacts" - Move-Item -Path $eventhub.FullName -Destination "artifacts\non_release_artifacts" - Move-Item -Path $databoxedge.FullName -Destination "artifacts\non_release_artifacts" - Move-Item -Path $monitor.FullName -Destination "artifacts\non_release_artifacts" - displayName: 'AzureStack (hide Az.Accounts/Az.IotHub/Az.EventHub/DataboxEdge/Monitor)' - condition: and(succeeded(), ne(variables['AzureStack'], 'false')) - - - pwsh: './tools/ExpandModules -Artifacts artifacts' - displayName: 'Expand modules' - condition: and(succeeded(), ne(variables['SignPsd1'], 'false')) - - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@4 - displayName: 'Psd1 Signing [Authenticode]' - inputs: - ConnectedServiceName: 'ESRP Signing Service' - FolderPath: artifacts - Pattern: 'tmp/**/*.psd1' - UseMinimatch: true - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "KeyCode": "CP-230012", - "OperationCode": "SigntoolSign", - "Parameters": { - "OpusName": "Microsoft", - "OpusInfo": "http://www.microsoft.com", - "FileDigest": "/fd \"SHA256\"", - "PageHash": "/NPH", - "TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - }, - "ToolName": "sign", - "ToolVersion": "1.0" - }, - { - "KeyCode": "CP-230012", - "OperationCode": "SigntoolVerify", - "Parameters": {}, - "ToolName": "sign", - "ToolVersion": "1.0" - } - ] - condition: and(succeeded(), ne(variables['SignPsd1'], 'false')) - - - pwsh: './tools/PackModules.ps1 -Artifacts artifacts -NugetExe tools\NuGet.exe' - displayName: 'Repackage modules' - condition: and(succeeded(), ne(variables['SignPsd1'], 'false')) - - - pwsh: | - ./tools/Docs/OutputTypeIndex.ps1 -OutputFile ./artifacts/outputtypes.json -BuildConfig Release - ./tools/Docs/HelpIndex.ps1 -OutputFile ./artifacts/index.json -BuildConfig Release - displayName: 'Post process for Docs' - condition: eq('${{ parameters.TargetModule }}', 'none') - - - - task: PublishBuildArtifacts@1 - displayName: 'Save artifacts' - inputs: - PathtoPublish: artifacts - ArtifactName: artifacts - condition: succeededOrFailed() - - - pwsh: | - $Env:Path += ";$Env:WIX"+"bin" - Register-PSRepository -Name MSIcreationrepository -SourceLocation $Env:RepoArtifacts -InstallationPolicy Trusted - ./setup/generate.ps1 -repository MSIcreationrepository - Unregister-PSRepository -Name MSIcreationrepository - displayName: 'Build Installer' - condition: eq(${{ parameters.buildInstaller }}, true) - - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@4 - displayName: 'Installer Signing [Authenticode]' - condition: eq(${{ parameters.buildInstaller }}, true) - inputs: - ConnectedServiceName: 'ESRP Signing Service' - FolderPath: setup - Pattern: '**/*.msi' - UseMinimatch: true - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "KeyCode": "CP-230012", - "OperationCode": "SigntoolSign", - "Parameters": { - "OpusName": "Microsoft", - "OpusInfo": "http://www.microsoft.com", - "FileDigest": "/fd \"SHA256\"", - "PageHash": "/NPH", - "TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - }, - "ToolName": "sign", - "ToolVersion": "1.0" - }, - { - "KeyCode": "CP-230012", - "OperationCode": "SigntoolVerify", - "Parameters": {}, - "ToolName": "sign", - "ToolVersion": "1.0" - } - ] - - - pwsh: | - $folderName = "$(LocalRepoName)" - New-Item -Path $Env:RepoArtifacts -Name $folderName -ItemType Directory -Force - - Import-LocalizedData -FileName Az.psd1 -BindingVariable "AzModuleInfo" -BaseDirectory .\tools\Az\ - $incluedModuleList = @("Az.$($AzModuleInfo.ModuleVersion).nupkg") - $incluedModuleList += $AzModuleInfo.RequiredModules | ForEach-Object { return $_.ModuleName + "."+$_.ModuleVersion+$_.RequiredVersion+".nupkg"} - - Copy-Item $Env:RepoArtifacts/*.nupkg -Destination $Env:RepoArtifacts/$folderName -Include $incluedModuleList - Get-ChildItem $Env:RepoArtifacts/$folderName - Copy-Item $Env:RepoArtifacts/$Env:Configuration/InstallModule.ps1 -Destination $Env:RepoArtifacts/$folderName - displayName: 'Gather nuget packages and install script' - condition: eq(${{ parameters.buildInstaller }}, true) - - - task: ArchiveFiles@2 - displayName: 'Pack nuget packages as Az-Cmdlets-latest.tar.gz' - condition: eq(${{ parameters.buildInstaller }}, true) - inputs: - rootFolderOrFile: 'artifacts/$(LocalRepoName)' - includeRootFolder: false - archiveType: tar - archiveFile: 'setup/Az-Cmdlets-latest.tar.gz' - - - pwsh: | - $msi= Get-Item .\setup\*.msi - if($msi.Count -lt 1) - { - throw "No msi available" - } - elseif($msi.Count -gt 1) - { - $msi = $msi[0] - } - $newName = $msi.BaseName.Substring(0,$msi.BaseName.Length-4) - $tarPath = "setup/Az-Cmdlets-latest.tar.gz" - Copy-Item $tarPath -Destination "setup/$newName.tar.gz" - $sha256 = Get-FileHash -Path "setup/$newName.tar.gz" - $value = "### SHA256 Hashes of the release artifacts`n" + - "* $newName.tar.gz`n" + - " - "+$sha256.Hash+"`n" - New-Item -Path "setup" -Name "ReleaseNotes.txt" -ItemType File -Force -Value $value - displayName: 'Rename Az-Cmdlets-latest.tar.gz and Calculate SHA256' - condition: eq(${{ parameters.buildInstaller }}, true) - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: installer' - condition: eq(${{ parameters.buildInstaller }}, true) - inputs: - PathtoPublish: setup - ArtifactName: setup - - - task: AzurePowerShell@5 - displayName: 'Push packages to storage account' - inputs: - azureSubscription: 'azureps-infra-sp' - ScriptType: InlineScript - Inline: | - $context = New-AzStorageContext -StorageAccountName "$(StorageAccountName)" - - # Push MSIs - $msi = Get-Item .\setup\*.msi - $msi | Set-AzStorageBlobContent -Container $(ContainerName) -Context $context -Force - - # Push tarball - $tarball = Get-Item .\setup\*.tar.gz - $tarball | Set-AzStorageBlobContent -Container $(ContainerName) -Context $context -Force - - # Push Az.Cmdlet-preview.zip - if($msi.Count -lt 1) - { - throw "No msi available" - } - elseif($msi.Count -gt 1) - { - $msi = $msi[0] - } - $buildName = $msi.BaseName.Substring(0,$msi.BaseName.Length-4) - Get-ChildItem -Path $Env:RepoArtifacts -Filter Az.*.0.*.*.nupkg | Compress-Archive -DestinationPath "$buildName-preview.zip" -PassThru | Set-AzStorageBlobContent -Container $(ContainerName) -Context $context -Force - azurePowerShellVersion: LatestVersion - pwsh: true - condition: and(succeeded(), eq(variables['PushPackageToStorageAccount'], 'true'), eq(${{ parameters.buildInstaller }}, true)) diff --git a/.azure-pipelines/sign-tool-installer.yml b/.azure-pipelines/sign-tool-installer.yml deleted file mode 100644 index 04bfc5a32101..000000000000 --- a/.azure-pipelines/sign-tool-installer.yml +++ /dev/null @@ -1,81 +0,0 @@ -trigger: none -pr: none - -pool: pool-windows-2019 - -steps: -- task: PowerShell@2 - displayName: 'Install platyPS' - inputs: - targetType: inline - script: 'Install-Module platyPS -Force -Confirm:$false -Scope CurrentUser' - pwsh: true - -- task: PowerShell@2 - displayName: 'Install PowerShellGet [v2.1.3 has a Publish-Module bug]' - inputs: - targetType: inline - script: 'Install-Module PowerShellGet -Force -Confirm:$false -Scope CurrentUser -SkipPublisherCheck' - -- task: DotNetCoreCLI@2 - displayName: 'Build' - inputs: - command: custom - custom: msbuild - arguments: 'tools\Az.Tools.Installer\build.proj /t:"Clean;Build;GenerateHelp" /p:Configuration=Release' - -- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@4 - displayName: 'Signing' - inputs: - ConnectedServiceName: $(signServiceConnection) - FolderPath: artifacts - Pattern: | - Tools/**/*.ps1 - Tools/**/*.psd1 - Tools/**/*.psm1 - Tools/**/*.ps1xml - UseMinimatch: true - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "KeyCode": "CP-230012", - "OperationCode": "SigntoolSign", - "Parameters": { - "OpusName": "Microsoft", - "OpusInfo": "http://www.microsoft.com", - "FileDigest": "/fd \"SHA256\"", - "PageHash": "/NPH", - "TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - }, - "ToolName": "sign", - "ToolVersion": "1.0" - }, - { - "KeyCode": "CP-230012", - "OperationCode": "SigntoolVerify", - "Parameters": {}, - "ToolName": "sign", - "ToolVersion": "1.0" - } - ] - -- task: DotNetCoreCLI@2 - displayName: Package - inputs: - command: custom - custom: msbuild - arguments: 'tools\Az.Tools.Installer\build.proj /t:Package /p:Configuration=Release' - -- task: ManifestGeneratorTask@0 - displayName: 'Generation Task' - inputs: - PackageName: 'Azure PowerShell - Az Tools Installer' - BuildDropPath: artifacts - -- task: PublishPipelineArtifact@0 - displayName: 'Save artifacts' - inputs: - artifactName: artifacts - targetPath: artifacts - condition: succeededOrFailed()