-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Peiyao/0227 test #37670
Draft
zhaopy536
wants to merge
10
commits into
main
Choose a base branch
from
peiyao/0227-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Peiyao/0227 test #37670
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b9534c1
fix conflict
jamrobot 3ccf993
add .gitignore
zhaopy536 9c93195
update expect.txt
zhaopy536 37dee4e
update
zhaopy536 694d23f
update
zhaopy536 408e638
test
zhaopy536 5be8af0
update
zhaopy536 1b62502
update
zhaopy536 42aa8a8
update
zhaopy536 88c12f9
update
zhaopy536 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
update
- Loading branch information
commit 88c12f9f0df36900f88534025040bba97edc0484
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
176 changes: 176 additions & 0 deletions
176
.pipelines/v2/templates/steps-build-installer-vnext.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
parameters: | ||
- name: versionNumber | ||
type: string | ||
default: "0.0.1" | ||
- name: buildUserInstaller | ||
type: boolean | ||
default: false | ||
- name: codeSign | ||
type: boolean | ||
default: false | ||
- name: signingIdentity | ||
type: object | ||
default: {} | ||
- name: additionalBuildOptions | ||
type: string | ||
default: '' | ||
|
||
steps: | ||
- pwsh: |- | ||
& git clean -xfd -e *exe -- .\installer\ | ||
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Clean installer to reduce cross-contamination | ||
- pwsh: |- | ||
$IsPerUser = $${{ parameters.buildUserInstaller }} | ||
$InstallerBuildSlug = "MachineSetup" | ||
$InstallerBasename = "PowerToysSetupVNext" | ||
If($IsPerUser) { | ||
$InstallerBuildSlug = "UserSetup" | ||
$InstallerBasename = "PowerToysUserSetup" | ||
} | ||
$InstallerBasename += "-${{ parameters.versionNumber }}-$(BuildPlatform)" | ||
Write-Host "##vso[task.setvariable variable=InstallerBuildSlug]$InstallerBuildSlug" | ||
Write-Host "##vso[task.setvariable variable=InstallerRelativePath]$(BuildPlatform)\$(BuildConfiguration)\$InstallerBuildSlug" | ||
Write-Host "##vso[task.setvariable variable=InstallerBasename]$InstallerBasename" | ||
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Prepare Installer variables | ||
# This dll needs to be built and signed before building the MSI. | ||
- task: VSBuild@1 | ||
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Build PowerToysSetupCustomActions | ||
inputs: | ||
solution: "**/installer/PowerToysSetupVNext.sln" | ||
vsVersion: 17.0 | ||
msbuildArgs: >- | ||
/t:PowerToysSetupCustomActions | ||
/p:RunBuildEvents=true;PerUser=${{parameters.buildUserInstaller}};RestorePackagesConfig=true;CIBuild=true | ||
-restore -graph | ||
/bl:$(LogOutputDirectory)\installer-$(InstallerBuildSlug)-actions.binlog | ||
${{ parameters.additionalBuildOptions }} | ||
platform: $(BuildPlatform) | ||
configuration: $(BuildConfiguration) | ||
clean: true | ||
msbuildArchitecture: x64 | ||
maximumCpuCount: true | ||
|
||
- ${{ if eq(parameters.codeSign, true) }}: | ||
- template: steps-esrp-signing.yml | ||
parameters: | ||
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign PowerToysSetupCustomActions | ||
signingIdentity: ${{ parameters.signingIdentity }} | ||
inputs: | ||
FolderPath: 'installer/PowerToysSetupCustomActions/$(InstallerRelativePath)' | ||
signType: batchSigning | ||
batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json' | ||
ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml' | ||
|
||
## INSTALLER START | ||
#### MSI BUILDING AND SIGNING | ||
- task: VSBuild@1 | ||
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Build MSI | ||
inputs: | ||
solution: "**/installer/PowerToysSetupVNext.sln" | ||
vsVersion: 17.0 | ||
msbuildArgs: >- | ||
-restore | ||
/t:PowerToysInstaller | ||
/p:RunBuildEvents=false;PerUser=${{parameters.buildUserInstaller}};BuildProjectReferences=false;CIBuild=true | ||
/bl:$(LogOutputDirectory)\installer-$(InstallerBuildSlug)-msi.binlog | ||
${{ parameters.additionalBuildOptions }} | ||
platform: $(BuildPlatform) | ||
configuration: $(BuildConfiguration) | ||
clean: false # don't undo our hard work above by deleting the CustomActions dll | ||
msbuildArchitecture: x64 | ||
maximumCpuCount: true | ||
|
||
- script: |- | ||
"C:\Program Files (x86)\WiX Toolset v3.14\bin\dark.exe" -x $(build.sourcesdirectory)\extractedMsi installer\PowerToysSetupVNext\$(InstallerRelativePath)\$(InstallerBasename).msi | ||
dir $(build.sourcesdirectory)\extractedMsi | ||
displayName: "${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Extract and verify MSI" | ||
# Check if deps.json files don't reference different dll versions. | ||
- pwsh: |- | ||
& '.pipelines/verifyDepsJsonLibraryVersions.ps1' -targetDir '$(build.sourcesdirectory)\extractedMsi\File' | ||
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Audit deps.json in MSI extracted files | ||
- ${{ if eq(parameters.codeSign, true) }}: | ||
- pwsh: |- | ||
& .pipelines/versionAndSignCheck.ps1 -targetDir '$(build.sourcesdirectory)\extractedMsi\File' | ||
& .pipelines/versionAndSignCheck.ps1 -targetDir '$(build.sourcesdirectory)\extractedMsi\Binary' | ||
git clean -xfd ./extractedMsi | ||
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Verify all binaries are signed and versioned | ||
- template: steps-esrp-signing.yml | ||
parameters: | ||
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign MSI | ||
signingIdentity: ${{ parameters.signingIdentity }} | ||
inputs: | ||
FolderPath: 'installer/PowerToysSetupVNext/$(InstallerRelativePath)' | ||
signType: batchSigning | ||
batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json' | ||
ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml' | ||
|
||
#### END MSI | ||
#### BOOTSTRAP BUILDING AND SIGNING | ||
|
||
- task: VSBuild@1 | ||
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Build Bootstrapper | ||
inputs: | ||
solution: "**/installer/PowerToysSetupVNext.sln" | ||
vsVersion: 17.0 | ||
msbuildArgs: >- | ||
/t:PowerToysBootstrapper | ||
/p:PerUser=${{parameters.buildUserInstaller}};CIBuild=true | ||
/bl:$(LogOutputDirectory)\installer-$(InstallerBuildSlug)-bootstrapper.binlog | ||
-restore -graph | ||
${{ parameters.additionalBuildOptions }} | ||
platform: $(BuildPlatform) | ||
configuration: $(BuildConfiguration) | ||
clean: false # don't undo our hard work above by deleting the MSI | ||
msbuildArchitecture: x64 | ||
maximumCpuCount: true | ||
|
||
# The entirety of bundle unpacking/re-packing is unnecessary if we are not code signing it. | ||
- ${{ if eq(parameters.codeSign, true) }}: | ||
- script: |- | ||
"C:\Program Files (x86)\WiX Toolset v3.14\bin\insignia.exe" -ib installer\PowerToysSetupVNext\$(InstallerRelativePath)\$(InstallerBasename).exe -o installer\engine.exe | ||
displayName: "${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Insignia: Extract Engine from Bundle" | ||
- template: steps-esrp-signing.yml | ||
parameters: | ||
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign WiX Engine | ||
signingIdentity: ${{ parameters.signingIdentity }} | ||
inputs: | ||
FolderPath: "installer" | ||
Pattern: engine.exe | ||
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" | ||
} | ||
] | ||
- script: |- | ||
"C:\Program Files (x86)\WiX Toolset v3.14\bin\insignia.exe" -ab installer\engine.exe installer\PowerToysSetupVNext\$(InstallerRelativePath)\$(InstallerBasename).exe -o installer\PowerToysSetupVNext\$(InstallerRelativePath)\$(InstallerBasename).exe | ||
displayName: "${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Insignia: Merge Engine into Bundle" | ||
- template: steps-esrp-signing.yml | ||
parameters: | ||
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign Final Bootstrapper | ||
signingIdentity: ${{ parameters.signingIdentity }} | ||
inputs: | ||
FolderPath: 'installer/PowerToysSetupVNext/$(InstallerRelativePath)' | ||
signType: batchSigning | ||
batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json' | ||
ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml' | ||
#### END BOOTSTRAP | ||
## END INSTALLER |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check failure
Code scanning / check-spelling
Check File Path Error