Skip to content

Commit 25e2c64

Browse files
committed
Updated module versioning to use module manifest rather than Git tags
1 parent afb4f63 commit 25e2c64

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Build.PSake.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ Task Setup {
3535
Set-Variable manifest -Value (Get-ModuleManifest) -Scope Script;
3636
Set-Variable buildPath -Value (Join-Path -Path $psake.build_script_dir -ChildPath "$buildDir\$($manifest.Name)") -Scope Script;
3737
Set-Variable releasePath -Value (Join-Path -Path $psake.build_script_dir -ChildPath $releaseDir) -Scope Script;
38-
Set-Variable version -Value (Get-GitVersionString) -Scope Script;
38+
$newModuleVersion = New-Object -TypeName System.Version -ArgumentList $manifest.Version.Major, $manifest.Version.Minor,$manifest.Version.Build,(Get-GitRevision);
39+
Set-Variable version -Value ($newModuleVersion.ToString()) -Scope Script;
3940

4041
Write-Host (' Building module "{0}".' -f $manifest.Name) -ForegroundColor Yellow;
4142
Write-Host (' Using Git version "{0}".' -f $version) -ForegroundColor Yellow;
@@ -102,7 +103,7 @@ Task Release {
102103
## Create a Github release
103104
$githubApiKey = (New-Object System.Management.Automation.PSCredential 'OAUTH', (Get-Content -Path $githubTokenPath | ConvertTo-SecureString)).GetNetworkCredential().Password;
104105
Write-Host (' Creating new Github "{0}" release in repository "{1}/{2}".' -f $version, $githubOwner, $manifest.Name) -ForegroundColor Yellow;
105-
#$release = New-GitHubRelease -Version $version -Repository $manifest.Name -Owner $githubOwner -ApiKey $githubApiKey;
106+
$release = New-GitHubRelease -Version $version -Repository $manifest.Name -Owner $githubOwner -ApiKey $githubApiKey;
106107
if ($release) {
107108
## Creates the release files in the $releaseDir
108109
$zipReleaseName = '{0}-v{1}.zip' -f $manifest.Name, $version;

0 commit comments

Comments
 (0)