Skip to content

Commit

Permalink
Fix the module versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
daxian-dbw committed Nov 14, 2024
1 parent eec2777 commit 1485941
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
16 changes: 0 additions & 16 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,6 @@ function Start-Build
Write-Host "`n[Build the AIShell module ...]`n" -ForegroundColor Green
$aish_module_csproj = GetProjectFile $module_dir
dotnet publish $aish_module_csproj -c $Configuration -o $module_out_dir

# Update version for the module manifest file.
$projectUrl = 'https://github.com/PowerShell/ProjectMercury'
$version = (Get-Item $module_out_dir/AIShell.Integration.dll).VersionInfo.ProductVersion
$privateData = "PrivateData = @{ PSData = @{ ProjectUri = '$projectUrl' } }"
if ($version -match "(.*)-(.*)") {
$version = $matches[1]
$prerelease = $matches[2]
# Put the prerelease tag in private data.
$privateData = "PrivateData = @{ PSData = @{ Prerelease = '$prerelease'; ProjectUri = '$projectUrl' } }"
}

$moduleManifest = Get-Content $module_out_dir/AIShell.psd1 -Raw
$moduleManifest = $moduleManifest -replace "ModuleVersion = '.*'", "ModuleVersion = '$version'"
$moduleManifest = $moduleManifest -replace "}", " ${privateData}`n}`n"
Set-Content -Path $module_out_dir/AIShell.psd1 -Value $moduleManifest -NoNewline
}

if ($LASTEXITCODE -eq 0) {
Expand Down
3 changes: 2 additions & 1 deletion shell/AIShell.Integration/AIShell.psd1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@{
RootModule = 'AIShell.psm1'
NestedModules = @("AIShell.Integration.dll")
ModuleVersion = '0.1.0'
ModuleVersion = '1.0.1'
GUID = 'ECB8BEE0-59B9-4DAE-9D7B-A990B480279A'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Expand All @@ -13,4 +13,5 @@
VariablesToExport = '*'
AliasesToExport = @('aish', 'askai', 'fixit')
HelpInfoURI = 'https://aka.ms/aishell-help'
PrivateData = @{ PSData = @{ Prerelease = 'preview1'; ProjectUri = 'https://github.com/PowerShell/ProjectMercury' } }
}

0 comments on commit 1485941

Please sign in to comment.