-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Publish PowerShell vPack for stable and better builds
#11960
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
Changes from all commits
a2212b6
899b69d
a7c8cf2
018e3da
25c4da7
559a74d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| parameters: | ||
| architecture: x64 | ||
|
|
||
| jobs: | ||
| - job: vpack_${{ parameters.architecture }} | ||
| displayName: Build and Publish VPack - ${{ parameters.architecture }} | ||
| condition: succeeded() | ||
| pool: Package ES Standard Build | ||
| steps: | ||
|
|
||
| - template: ./SetVersionVariables.yml | ||
| parameters: | ||
| ReleaseTagVar: $(ReleaseTagVar) | ||
|
|
||
| - pwsh: | | ||
| $azcopy = "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe" | ||
|
|
||
| Write-Host "running: $azcopy /Source:https://$(StorageAccount).blob.core.windows.net/$(AzureVersion) /Dest:$(System.ArtifactsDirectory) /S /SourceKey:****** /Pattern:PowerShell-$(Version)-win-${{ parameters.architecture }}.zip /Z:$(AGENT.TEMPDIRECTORY)" | ||
| & $azcopy /Source:https://$(StorageAccount).blob.core.windows.net/$(AzureVersion) /Dest:$(System.ArtifactsDirectory) /S /SourceKey:$(StorageAccountKey) /Pattern:PowerShell-$(Version)-win-${{ parameters.architecture }}.zip /Z:$(AGENT.TEMPDIRECTORY) | ||
| displayName: 'Download Azure Artifacts' | ||
|
|
||
| - pwsh: 'Get-ChildItem $(System.ArtifactsDirectory)\* -recurse | Select-Object -ExpandProperty Name' | ||
| displayName: 'Capture Artifact Listing' | ||
|
|
||
| - pwsh: | | ||
| $message = @() | ||
| Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -include *.zip, *.msi | ForEach-Object { | ||
| if($_.Name -notmatch 'PowerShell-\d\.\d\.\d\-([a-z]*.\d+\-)?win\-(fxdependent|x64|arm32|arm64|x86|fxdependentWinDesktop)\.(msi|zip){1}') | ||
| { | ||
| $messageInstance = "$($_.Name) is not a valid package name" | ||
| $message += $messageInstance | ||
| Write-Warning $messageInstance | ||
| } | ||
| } | ||
|
|
||
| if($message.count -gt 0){throw ($message | out-string)} | ||
| displayName: 'Validate Zip and MSI Package Names' | ||
|
|
||
| - pwsh: | | ||
| Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -include *.zip, *.msi | ForEach-Object { | ||
| if($_.Name -match 'PowerShell-\d\.\d\.\d\-([a-z]*.\d+\-)?win\-(${{ parameters.architecture }})\.(zip){1}') | ||
| { | ||
| $destDir = "$(System.ArtifactsDirectory)\vpack${{ parameters.architecture }}" | ||
| $null = new-item -ItemType Directory -Path $destDir | ||
| Expand-Archive -Path $_.FullName -DestinationPath $destDir | ||
| $vstsCommandString = "vso[task.setvariable variable=vpackDir]$destDir" | ||
| Write-Host "sending " + $vstsCommandString | ||
| Write-Host "##$vstsCommandString" | ||
| } | ||
| } | ||
| displayName: 'Extract Zip' | ||
|
|
||
| - pwsh: | | ||
| $vpackVersion = '$(version)' | ||
|
|
||
| if('$(VPackPublishOverride)' -ne '' -and '$(VPackPublishOverride)' -ne 'None' ) | ||
| { | ||
| Write-Host "Using VPackPublishOverride varabile" | ||
| $vpackVersion = '$(VPackPublishOverride)' | ||
| } | ||
|
|
||
| $vstsCommandString = "vso[task.setvariable variable=vpackVersion]$vpackVersion" | ||
| Write-Host "sending " + $vstsCommandString | ||
| Write-Host "##$vstsCommandString" | ||
| displayName: 'Set vpackVersion' | ||
|
|
||
| - pwsh: | | ||
| Get-ChildItem -Path env: | ||
| displayName: Capture Environment | ||
| condition: succeededOrFailed() | ||
|
|
||
| - task: PkgESVPack@10 | ||
| displayName: 'Package ES - VPack ' | ||
| env: | ||
| SYSTEM_ACCESSTOKEN: $(System.AccessToken) | ||
| inputs: | ||
| sourceDirectory: '$(vpackDir)' | ||
| description: PowerShell ${{ parameters.architecture }} $(version) | ||
| pushPkgName: 'PowerShell.${{ parameters.architecture }}' | ||
| configurations: Release | ||
| platforms: x64 | ||
| target: '$(System.ArtifactsDirectory)' | ||
| owner: tplunk | ||
| provData: false | ||
| version: '$(vpackVersion)' | ||
| condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual')) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: vpack-$(Build.BuildId) | ||
| trigger: | ||
| branches: | ||
| include: | ||
| - master | ||
| - release* | ||
| pr: | ||
| branches: | ||
| include: | ||
| - master | ||
| - release* | ||
|
|
||
| variables: | ||
| - name: DOTNET_CLI_TELEMETRY_OPTOUT | ||
| value: 1 | ||
| - name: POWERSHELL_TELEMETRY_OPTOUT | ||
| value: 1 | ||
| - group: Azure Blob variable group | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @adityapatwardhan Note that this YAML tells what variable groups it needs |
||
|
|
||
| # Set AzDevOps Agent to clean the machine after the end of the build | ||
| resources: | ||
| - repo: self | ||
| clean: true | ||
|
|
||
| jobs: | ||
| - job: rename | ||
| displayName: Name the build | ||
| condition: succeeded() | ||
| pool: | ||
| vmImage: 'windows-latest' | ||
| steps: | ||
|
|
||
| - template: ./templates/SetVersionVariables.yml | ||
| parameters: | ||
| ReleaseTagVar: $(ReleaseTagVar) | ||
|
|
||
| - powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhss"))" | ||
| displayName: Set Build Name for Non-PR | ||
| condition: ne(variables['Build.Reason'], 'PullRequest') | ||
|
|
||
| - template: ./templates/vpackReleaseJob.yml | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we consider:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did number 2 Let's leave 1 for when we integrate this into a deployment yaml. |
||
| parameters: | ||
| architecture: x64 | ||
|
|
||
| - template: ./templates/vpackReleaseJob.yml | ||
| parameters: | ||
| architecture: x86 | ||
|
|
||
| - template: ./templates/vpackReleaseJob.yml | ||
| parameters: | ||
| architecture: arm32 | ||
|
|
||
| - template: ./templates/vpackReleaseJob.yml | ||
| parameters: | ||
| architecture: arm64 | ||
Uh oh!
There was an error while loading. Please reload this page.