Skip to content

Commit

Permalink
Separate out the nuget, CmdPal, and PT versions (#406)
Browse files Browse the repository at this point in the history
Fixes #345 

This adds a pair of variables to allow us to set the CmdPal version separately from the PT version.

Also fixes up some naming of the nuget package
  • Loading branch information
zadjii-msft authored Feb 5, 2025
1 parent b932237 commit da40c44
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
13 changes: 12 additions & 1 deletion .pipelines/v2/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ parameters:
type: string
default: '0.0.1'

- name: cmdPalVersionNumber
displayName: "Command Palette Version Number"
type: string
default: '0.0.1'

- name: cmdPalSdkVersionNumber
displayName: "Command Palette SDK Version Number"
type: string
default: '0.0.1'

- name: buildConfigurations
displayName: "Build Configurations"
type: object
Expand Down Expand Up @@ -93,7 +103,7 @@ extends:
beforeBuildSteps:
# Sets versions for all PowerToy created DLLs
- pwsh: |-
.pipelines/versionSetting.ps1 -versionNumber '${{ parameters.versionNumber }}' -DevEnvironment ''
.pipelines/versionSetting.ps1 -versionNumber '${{ parameters.versionNumber }}' -DevEnvironment '' -cmdPalVersionNumber '${{ parameters.cmdPalVersionNumber }}'
displayName: Prepare versioning
# Prepare the localizations and telemetry config before the release build
Expand All @@ -116,6 +126,7 @@ extends:
image: SHINE-VS17-Latest
os: windows
codeSign: true
sdkVersionNumber: ${{ parameters.cmdPalSdkVersionNumber }}
signingIdentity:
serviceName: $(SigningServiceName)
appId: $(SigningAppId)
Expand Down
9 changes: 6 additions & 3 deletions .pipelines/versionSetting.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ Param(

[Parameter(Mandatory=$True,Position=2)]
[AllowEmptyString()]
[string]$DevEnvironment = "Local"
[string]$DevEnvironment = "Local",

[Parameter(Mandatory=$True,Position=3)]
[string]$cmdPalVersionNumber = "0.0.1"
)

Write-Host $PSScriptRoot
Expand Down Expand Up @@ -38,7 +41,7 @@ $verPropReadFileLocation = $verPropWriteFileLocation;
$verProps.Project.PropertyGroup.Version = $versionNumber;
$verProps.Project.PropertyGroup.DevEnvironment = $DevEnvironment;

Write-Host "xml" $verProps.Project.PropertyGroup.Version
Write-Host "xml" $verProps.Project.PropertyGroup.Version
$verProps.Save($verPropWriteFileLocation);

# Set PowerRenameContextMenu package version in AppManifest.xml
Expand Down Expand Up @@ -82,6 +85,6 @@ $cmdPalAppManifestWriteFileLocation = $PSScriptRoot + '/../src/modules/cmdpal/Mi
$cmdPalAppManifestReadFileLocation = $cmdPalAppManifestWriteFileLocation;

[XML]$cmdPalAppManifest = Get-Content $cmdPalAppManifestReadFileLocation
$cmdPalAppManifest.Package.Identity.Version = $versionNumber + '.0'
$cmdPalAppManifest.Package.Identity.Version = $cmdPalVersionNumber + '.0'
Write-Host "CmdPal Package version: " $cmdPalAppManifest.Package.Identity.Version
$cmdPalAppManifest.Save($cmdPalAppManifestWriteFileLocation);
2 changes: 1 addition & 1 deletion src/modules/cmdpal/extensionsdk/nuget/BuildSDKHelper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if (($BuildStep -ieq "all") -Or ($BuildStep -ieq "pack")) {
if ($config -eq "release")
{
New-Item -ItemType Directory -Force -Path "$PSScriptRoot\..\_build"
& $nugetPath pack (Join-Path $PSScriptRoot "Microsoft.CommandPalette.Extensions.nuspec") -Version $VersionOfSDK -OutputDirectory "$PSScriptRoot\..\_build"
& $nugetPath pack (Join-Path $PSScriptRoot "Microsoft.CommandPalette.Extensions.SDK.nuspec") -Version $VersionOfSDK -OutputDirectory "$PSScriptRoot\..\_build"
} else {
Write-Host @"
WARNING: You are currently building as '$config' configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata minClientVersion="2.5">
<id>Microsoft.CommandPalette.Extensions</id>
<version>0.0.0</version>
<title>Command Palette SDK</title>
<title>Command Palette Extension SDK</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand All @@ -26,9 +26,12 @@
<!-- AnyCPU Managed dlls from SDK.Lib project -->
<file src="..\Microsoft.CommandPalette.Extensions.Toolkit\x64\release\Microsoft.CommandPalette.Extensions.Toolkit\Microsoft.CommandPalette.Extensions.Toolkit.dll" target="lib\net8.0-windows10.0.19041.0\"/>
<file src="..\Microsoft.CommandPalette.Extensions.Toolkit\x64\release\Microsoft.CommandPalette.Extensions.Toolkit\Microsoft.CommandPalette.Extensions.Toolkit.deps.json" target="lib\net8.0-windows10.0.19041.0\"/>

<!-- Native dlls and winmd from SDK cpp project -->
<!-- TODO: we may not need this, since there are no implementations in the Microsoft.CommandPalette.Extensions namespace -->
<file src="..\Microsoft.CommandPalette.Extensions\x64\release\Microsoft.CommandPalette.Extensions\Microsoft.CommandPalette.Extensions.dll" target="runtimes\win-x64\native\"/>
<file src="..\Microsoft.CommandPalette.Extensions\arm64\release\Microsoft.CommandPalette.Extensions\Microsoft.CommandPalette.Extensions.dll" target="runtimes\win-arm64\native\"/>

<!-- Not putting in the following the lib folder because we don't want plugin project to directly reference the winmd -->
<file src="..\Microsoft.CommandPalette.Extensions\x64\release\Microsoft.CommandPalette.Extensions\Microsoft.CommandPalette.Extensions.winmd" target="winmd\"/>
</files>
Expand Down

0 comments on commit da40c44

Please sign in to comment.