Skip to content

Commit

Permalink
SqlServerDsc: Add release asset for Wiki documentation (#1970)
Browse files Browse the repository at this point in the history
- SqlServerDsc
  - Now package the Wiki content and adds it as a GitHub Release asset so it
    is simpler to get the documentation for a specific version.
  • Loading branch information
johlju authored Sep 10, 2023
1 parent 9de42c3 commit 79d2393
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- SqlServerDsc
- Updated pipeline files to support ModuleFast.
- `Get-SqlDscPreferredModule`
- Optionally specify what version of the the SQL preferred module to be imported using the SMODefaultModuleVersion environment variable ([issue #1965](https://github.com/dsccommunity/SqlServerDsc/issues/1965)).
- Optionally specify what version of the the SQL preferred module to
be imported using the SMODefaultModuleVersion environment variable
([issue #1965](https://github.com/dsccommunity/SqlServerDsc/issues/1965)).
- Now package the Wiki content and adds it as a GitHub Release asset so it
is simpler to get the documentation for a specific version.
- New private command:
- Get-SMOModuleCalculatedVersion - Returns the version of the SMO module as a string. SQLPS version 120 and 130 do not have the correct version set, so the file path is used to calculate the version.
- Get-SMOModuleCalculatedVersion - Returns the version of the SMO module
as a string. SQLPS version 120 and 130 do not have the correct version set,
so the file path is used to calculate the version.
- SqlSetup
- Added the parameter `SqlVersion` that can be used to set the SQL Server
version to be installed instead of it looking for version in the setup
Expand Down
39 changes: 39 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ BuildWorkflow:
- Create_Changelog_Release_Output
- Generate_Conceptual_Help
- Generate_Wiki_Content
- Package_WikContent

fastbuild:
- Clean
Expand All @@ -37,6 +38,42 @@ BuildWorkflow:
- Publish_Module_To_gallery
- Publish_GitHub_Wiki_Content

Package_WikContent: |
{
<#
This is quick fix for issue https://github.com/PoshCode/ModuleBuilder/issues/103.
Aliases need to be added to module manifest, and we can only use
New-Alias or Set-Alias together with build tasks. This module
already automatically exports aliases using [Alias()] so this quick
fix is meant as a workaround until the above issue is resolved.
#>
param
(
$OutputDirectory = (property OutputDirectory (Join-Path $BuildRoot 'output')),
$ProjectName = (property ProjectName $(Get-SamplerProjectName -BuildRoot $BuildRoot)),
$BuildInfo = (property BuildInfo @{ })
)
"`tProject Name = {0}" -f $ProjectName
"`tOutput Directory = {0}" -f $OutputDirectory
$wikiOutputPath = Join-Path -Path $OutputDirectory -ChildPath 'WikiContent'
$wikiArchiveSourcePath = Join-Path -Path $wikiOutputPath -ChildPath '*'
$wikiPackagePath = Join-Path -Path $OutputDirectory -ChildPath 'WikiContent.zip'
"`tWiki Output Path = $wikiOutputPath"
"`tWiki Archive Source Path = $wikiArchiveSourcePath"
"`tWiki Package Path = $wikiPackagePath"
if (-not (Test-Path -Path $wikiOutputPath))
{
throw 'The Wiki Output Path does not exist. Please run the task Generate_Wiki_Content prior to running this task.'
}
# Overwrites any existing archive.
Compress-Archive -Path $wikiArchiveSourcePath -DestinationPath $wikiPackagePath -CompressionLevel 'Optimal' -Force -ErrorAction 'Stop'
}
####################################################
# ModuleBuilder Configuration #
####################################################
Expand Down Expand Up @@ -151,6 +188,8 @@ Resolve-Dependency:
GitHubConfig:
GitHubFilesToAdd:
- 'CHANGELOG.md'
ReleaseAssets:
- output/WikiContent.zip
GitHubConfigUserName: dscbot # cSpell: disable-line
GitHubConfigUserEmail: [email protected]
UpdateChangelogOnPrerelease: false
Expand Down

0 comments on commit 79d2393

Please sign in to comment.