Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit74af3bf

Browse files
pwshBotdaxian-dbwTravisEz13
authored
[release/v7.5] Publish.msixbundle package as a VPack (#25621)
Co-authored-by: Dongbo Wang <dongbow@microsoft.com>Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
1 parent63cccc6 commit74af3bf

File tree

5 files changed

+171
-6
lines changed

5 files changed

+171
-6
lines changed
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
trigger:none
2+
3+
parameters:# parameters are shown up in ADO UI in a build queue time
4+
-name:'createVPack'
5+
displayName:'Create and Submit VPack'
6+
type:boolean
7+
default:true
8+
-name:'debug'
9+
displayName:'Enable debug output'
10+
type:boolean
11+
default:false
12+
-name:'ReleaseTagVar'
13+
type:string
14+
displayName:'Release Tag Var:'
15+
default:'fromBranch'
16+
17+
name:msixbundle_vPack_$(date:yyMM).$(date:dd)$(rev:rrr)
18+
19+
variables:
20+
CDP_DEFINITION_BUILD_COUNT:$[counter('', 0)]
21+
system.debug:${{ parameters.debug }}
22+
BuildSolution:$(Build.SourcesDirectory)\dirs.proj
23+
ReleaseTagVar:${{ parameters.ReleaseTagVar }}
24+
BuildConfiguration:Release
25+
WindowsContainerImage:'onebranch.azurecr.io/windows/ltsc2019/vse2022:latest'
26+
Codeql.Enabled:false# pipeline is not building artifacts; it repackages existing artifacts into a vpack
27+
DOTNET_CLI_TELEMETRY_OPTOUT:1
28+
POWERSHELL_TELEMETRY_OPTOUT:1
29+
30+
resources:
31+
repositories:
32+
-repository:templates
33+
type:git
34+
name:OneBranch.Pipelines/GovernedTemplates
35+
ref:refs/heads/main
36+
37+
pipelines:
38+
-pipeline:PSPackagesOfficial
39+
source:'PowerShell-Packages-Official'
40+
trigger:
41+
branches:
42+
include:
43+
-master
44+
-releases/*
45+
46+
extends:
47+
template:v2/Microsoft.Official.yml@templates
48+
parameters:
49+
platform:
50+
name:'windows_undocked'# windows undocked
51+
52+
cloudvault:
53+
enabled:false
54+
55+
globalSdl:
56+
useCustomPolicy:true# for signing code
57+
disableLegacyManifest:true
58+
# disabled Armory as we dont have any ARM templates to scan. It fails on some sample ARM templates.
59+
armory:
60+
enabled:false
61+
sbom:
62+
enabled:true
63+
compiled:
64+
enabled:false
65+
credscan:
66+
enabled:true
67+
scanFolder:$(Build.SourcesDirectory)
68+
suppressionsFile:$(Build.SourcesDirectory)\.config\suppress.json
69+
binskim:
70+
enabled:false
71+
# APIScan requires a non-Ready-To-Run build
72+
apiscan:
73+
enabled:false
74+
asyncSDL:
75+
enabled:false
76+
tsaOptionsFile:.config/tsaoptions.json
77+
78+
stages:
79+
-stage:build
80+
jobs:
81+
-job:main
82+
pool:
83+
type:windows
84+
85+
variables:
86+
ob_outputDirectory:'$(BUILD.SOURCESDIRECTORY)\out'
87+
ob_createvpack_enabled:${{ parameters.createVPack }}
88+
ob_createvpack_packagename:'PowerShell.app'
89+
ob_createvpack_owneralias:'dongbow'
90+
ob_createvpack_description:'VPack for the PowerShell Application'
91+
ob_createvpack_targetDestinationDirectory:'$(Destination)'
92+
ob_createvpack_propsFile:false
93+
ob_createvpack_provData:true
94+
ob_createvpack_metadata:'$(Build.SourceVersion)'
95+
ob_createvpack_versionAs:string
96+
ob_createvpack_version:'$(version)'
97+
ob_createvpack_verbose:true
98+
99+
steps:
100+
-template:.pipelines/templates/SetVersionVariables.yml@self
101+
parameters:
102+
ReleaseTagVar:$(ReleaseTagVar)
103+
UseJson:no
104+
105+
-pwsh:|
106+
Write-Verbose -Verbose 'PowerShell Version: $(version)'
107+
if('$(version)' -match '-') {
108+
throw "Don't release a preview build msixbundle package"
109+
}
110+
displayName: Stop any preview release
111+
112+
-download:PSPackagesOfficial
113+
artifact:'drop_msixbundle_CreateMSIXBundle'
114+
displayName:Download package
115+
116+
-pwsh:|
117+
$payloadDir = '$(Pipeline.Workspace)\PSPackagesOfficial\drop_msixbundle_CreateMSIXBundle'
118+
Get-ChildItem $payloadDir -Recurse | Out-String -Width 150
119+
$vstsCommandString = "vso[task.setvariable variable=PayloadDir]$payloadDir"
120+
Write-Host "sending " + $vstsCommandString
121+
Write-Host "##$vstsCommandString"
122+
displayName: 'Capture Artifact Listing'
123+
124+
-pwsh:|
125+
$bundlePackage = Get-ChildItem '$(PayloadDir)\*.msixbundle'
126+
Write-Verbose -Verbose ("MSIX bundle package: " + $bundlePackage.FullName -join ', ')
127+
if ($bundlePackage.Count -ne 1) {
128+
throw "Expected to find 1 MSIX bundle package, but found $($bundlePackage.Count)"
129+
}
130+
131+
if (-not (Test-Path '$(ob_outputDirectory)' -PathType Container)) {
132+
$null = New-Item '$(ob_outputDirectory)' -ItemType Directory -ErrorAction Stop
133+
}
134+
135+
$targetPath = Join-Path '$(ob_outputDirectory)' 'Microsoft.PowerShell_8wekyb3d8bbwe.msixbundle'
136+
Copy-Item -Verbose -Path $bundlePackage.FullName -Destination $targetPath
137+
displayName: 'Stage msixbundle for vpack'
138+
139+
-pwsh:|
140+
Write-Verbose "VPack Version: $(ob_createvpack_version)" -Verbose
141+
$vpackFiles = Get-ChildItem -Path $(ob_outputDirectory)\* -Recurse
142+
if($vpackFiles.Count -eq 0) {
143+
throw "No files found in $(ob_outputDirectory)"
144+
}
145+
$vpackFiles | Out-String -Width 150
146+
displayName: Debug Output Directory and Version
147+
condition: succeededOrFailed()

‎.pipelines/PowerShell-Release-Official.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,11 @@ extends:
368368
jobs:
369369
-template:/.pipelines/templates/approvalJob.yml@self
370370
parameters:
371-
displayName:Start vPack Releasepipeline
371+
displayName:Start2vPack Releasepipelines
372372
jobName:PublishVPack
373373
instructions:|
374-
Kick off vPack release pipeline
374+
1. Kick off PowerShell-vPack-Official pipeline
375+
2. Kick off PowerShell-MSIXBundle-VPack pipeline
375376
376377
# Need to verify if the Az PS / CLI team still uses this. Skippinng for this release.
377378
# - stage: ReleaseDeps

‎.pipelines/templates/SetVersionVariables.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ steps:
2323
}
2424
if(Test-Path -Path $path)
2525
{
26-
Write-Verbose "reporootdetect at: ." -Verbose
26+
Write-Verbose "reporootdetected at: ." -Verbose
2727
$repoRoot = '.'
2828
}
2929
else{
@@ -51,7 +51,7 @@ steps:
5151
$REPOROOT = $env:REPOROOT
5252
5353
if (-not (Test-Path $REPOROOT/tools/releaseBuild/setReleaseTag.ps1)) {
54-
if ((Test-Path "$REPOROOT/PowerShell/tools/releaseBuild/setReleaseTag.ps1")) {
54+
if (Test-Path "$REPOROOT/PowerShell/tools/releaseBuild/setReleaseTag.ps1") {
5555
$REPOROOT = "$REPOROOT/PowerShell"
5656
} else {
5757
throw "Could not find setReleaseTag.ps1 in $REPOROOT/tools/releaseBuild or $REPOROOT/PowerShell/tools/releaseBuild"
@@ -72,7 +72,7 @@ steps:
7272
ob_restore_phase:true# This ensures this done in restore phase to workaround signing issue
7373

7474
-powershell:|
75-
Get-ChildItem -Pathenv:
75+
Get-ChildItem -PathEnv: | Out-String -Width 150
7676
displayName:Capture environment
7777
condition:succeededOrFailed()
7878
env:

‎assets/AppxManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@
4848
<rescap:CapabilityName="packageManagement" />
4949
<rescap:CapabilityName="packageQuery" />
5050
</Capabilities>
51+
<mp:PhoneIdentityPhoneProductId="$PHONEPRODUCTID$"PhonePublisherId="95d94207-0c7c-47ed-82db-d75c81153c35" />
5152
</Package>

‎tools/packaging/packaging.psm1

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3702,8 +3702,17 @@ function New-MSIXPackage
37023702

37033703
$ProductVersion=Get-WindowsVersion-PackageName$packageName
37043704

3705+
# Any app that is submitted to the Store must have a PhoneIdentity in its appxmanifest.
3706+
# If you submit a package without this information to the Store, the Store will silently modify your package to include it.
3707+
# To find the PhoneProductId value, you need to run a package through the Store certification process,
3708+
# and use the PhoneProductId value from the Store certified package to update the manifest in your source code.
3709+
# This is the PhoneProductId for the "Microsoft.PowerShell" package.
3710+
$PhoneProductId="5b3ae196-2df7-446e-8060-94b4ad878387"
3711+
37053712
$isPreview=Test-IsPreview-Version$ProductSemanticVersion
37063713
if ($isPreview) {
3714+
# This is the PhoneProductId for the "Microsoft.PowerShellPreview" package.
3715+
$PhoneProductId="67859fd2-b02a-45be-8fb5-62c569a3e8bf"
37073716
Write-Verbose"Using Preview assets"-Verbose
37083717
}
37093718

@@ -3713,7 +3722,14 @@ function New-MSIXPackage
37133722
$releasePublisher='CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US'
37143723

37153724
$appxManifest=Get-Content"$RepoRoot\assets\AppxManifest.xml"-Raw
3716-
$appxManifest=$appxManifest.Replace('$VERSION$',$ProductVersion).Replace('$ARCH$',$Architecture).Replace('$PRODUCTNAME$',$productName).Replace('$DISPLAYNAME$',$displayName).Replace('$PUBLISHER$',$releasePublisher)
3725+
$appxManifest=$appxManifest.
3726+
Replace('$VERSION$',$ProductVersion).
3727+
Replace('$ARCH$',$Architecture).
3728+
Replace('$PRODUCTNAME$',$productName).
3729+
Replace('$DISPLAYNAME$',$displayName).
3730+
Replace('$PUBLISHER$',$releasePublisher).
3731+
Replace('$PHONEPRODUCTID$',$PhoneProductId)
3732+
37173733
$xml= [xml]$appxManifest
37183734
if ($isPreview) {
37193735
Write-Verbose-Verbose"Adding pwsh-preview.exe alias"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp