Files
PowerToys/.pipelines/v2/templates/job-build-sdk.yml
Dustin L. Howett a71cc282d3 cmdpal: use the unified Windows Terminal Versioning scheme (#39320)
This pull request adopts the unified versioning scheme used by Windows Terminal, Notepad, and hundreds of other internal and public projects that relied on "XES" or "PackageES".

It only does so for the command palette.

All command palette assets will be versioned according to the Major and Minor number in `src/modules/cmdpal/custom.props`. This includes DLLs, EXEs, NuGet packages and MSIX bundles.

This will ensure that all artifacts that we produce are versioned
properly:

| thing   | version (ex.)   |
|---------|-----------------|
| dll/exe | 0.2.2505.08001  |
| nupkg   | 0.2.250508001   |
| appx    | 0.2.3269.0      |

For reference, here's the version format:

### EXE, DLL, .NET Assembly

    0.2.2505.08001
    ^ ^  ^ ^  ^  ^
    | |  | |  |  `-Build # on that date
    | |  | |  `-Day
    | |  | `-Month
    | |  `-Year
    | `-Minor
    `-Major

### NuGet Package

    0.2.250508001
    ^ ^  ^ ^ ^  ^
    | |  | | |  `-Build # on that date
    | |  | | `-Day
    | |  | `-Month
    | |  `-Year
    | `-Minor
    `-Major

### AppX Package

    0.2.01281.0 (the leading 0 will be removed)
    ^ ^ ^  ^^ ^
    | | |  || `-Contractually always zero (a waste)
    | | |  |`-Build # on that date
    | | |  `-Number of days in [base year]
    | | `-Number of years since [base year]
    | `-Minor
    `-Major
    
    [base year] = $(XesBaseYearForStoreVersion)

It is expected that the base year is changed every time the version
number is changed.
2025-05-14 14:15:19 -05:00

101 lines
3.0 KiB
YAML

parameters:
- name: buildConfigurations
type: object
default:
- Release
- name: official
type: boolean
default: false
- name: codeSign
type: boolean
default: false
- name: pool
type: object
default: []
- name: signingIdentity
type: object
default: {}
jobs:
- job: "BuildSDK"
${{ if ne(length(parameters.pool), 0) }}:
pool: ${{ parameters.pool }}
displayName: Build SDK
timeoutInMinutes: 240
cancelTimeoutInMinutes: 1
templateContext: # Required when this template is hosted in 1ES PT
outputs:
- output: pipelineArtifact
artifactName: SDK
targetPath: $(Build.ArtifactStagingDirectory)
steps:
- checkout: self
clean: true
submodules: true
persistCredentials: True
fetchTags: false
fetchDepth: 1
- template: .\steps-ensure-nuget-version.yml
- task: NuGetAuthenticate@1
- ${{ if eq(parameters.official, true) }}:
- template: .\steps-setup-versioning.yml
parameters:
directory: $(build.sourcesdirectory)\src\modules\cmdpal
- pwsh: |-
& "$(build.sourcesdirectory)\src\modules\cmdpal\extensionsdk\nuget\BuildSDKHelper.ps1" -Configuration "Release" -BuildStep "build" -IsAzurePipelineBuild
displayName: Build SDK
- ${{ if eq(parameters.codeSign, true) }}:
- template: steps-esrp-signing.yml
parameters:
displayName: Sign SDK
signingIdentity: ${{ parameters.signingIdentity }}
inputs:
FolderPath: 'src/modules'
signType: batchSigning
batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_sdk.json'
ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml'
- pwsh: |-
& "$(build.sourcesdirectory)\src\modules\cmdpal\extensionsdk\nuget\BuildSDKHelper.ps1" -Configuration "Release" -BuildStep "pack" -IsAzurePipelineBuild
displayName: Pack SDK
- task: CopyFiles@2
displayName: Copy Nuget to Artifact Staging
inputs:
sourceFolder: "$(build.sourcesdirectory)/src/modules/cmdpal/extensionsdk/_build"
contents: '*.nupkg'
targetFolder: '$(Build.ArtifactStagingDirectory)'
- ${{ if eq(parameters.codeSign, true) }}:
- template: steps-esrp-signing.yml
parameters:
displayName: Sign NuGet packages
signingIdentity: ${{ parameters.signingIdentity }}
inputs:
FolderPath: $(Build.ArtifactStagingDirectory)
Pattern: '*.nupkg'
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: >-
[
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetSign",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]