Skip to content

Commit

Permalink
Merge branch 'release/0.0.3' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
abbgrade committed Oct 29, 2024
2 parents 2401db4 + b5f8cb7 commit cc06c71
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ on:

jobs:
build-validation:
uses: abbgrade/PsBuildTasks/.github/workflows/build-validation-matrix.yml@1.10.0
uses: abbgrade/PsBuildTasks/.github/workflows/build-validation-matrix.yml@1.11.0
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
pre-release:
uses: abbgrade/PsBuildTasks/.github/workflows/pre-release-windows.yml@1.10.0
uses: abbgrade/PsBuildTasks/.github/workflows/pre-release-windows.yml@1.11.0
with:
module-name: PSDependHelper
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
release:
uses: abbgrade/PsBuildTasks/.github/workflows/release-windows.yml@1.10.0
uses: abbgrade/PsBuildTasks/.github/workflows/release-windows.yml@1.11.0
with:
module-name: PSDependHelper
secrets:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.3] - 2024-10-29

### Added

- Added `Exclude` parameter to `Find-OutdatedDependency` function.
Expand Down
4 changes: 2 additions & 2 deletions src/PSDependHelper.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PSDependHelper.psm1'

# Version number of this module.
ModuleVersion = '0.0.2'
ModuleVersion = '0.0.3'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -69,7 +69,7 @@ RequiredModules = 'PsdKit'
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
# FunctionsToExport = '*'
FunctionsToExport = '*'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
# CmdletsToExport = '*'
Expand Down
35 changes: 13 additions & 22 deletions tasks/Build.Tasks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
requires ModuleName

[System.IO.DirectoryInfo] $SourceDirectory = "$PsScriptRoot/../src"
[System.IO.DirectoryInfo] $PublicFunctionsDirectory = "$SourceDirectory/Public"
[System.IO.DirectoryInfo] $SourceManifest = "$SourceDirectory/$ModuleName.psd1"
[System.IO.DirectoryInfo] $PublishDirectory = "$PsScriptRoot/../publish"
[System.IO.DirectoryInfo] $DocumentationDirectory = "$PsScriptRoot/../docs"
Expand All @@ -17,7 +16,7 @@ task Clean -Jobs {

# Synopsis: Import the module.
task Import -Jobs {
Import-Module $SourceManifest -Force
Import-Module $SourceManifest -Force
}

# Synopsis: Import platyPs.
Expand All @@ -26,18 +25,18 @@ task Import.platyPs -Jobs {
}

# Synopsis: Initialize the documentation directory.
task Doc.Init.Directory -If { $DocumentationDirectory.Exists -eq $false } -Jobs {
task Doc.Init.Directory -If { $DocumentationDirectory.Exists -eq $false} -Jobs {
New-Item $DocumentationDirectory -ItemType Directory
}

# Synopsis: Initialize the documentation.
task Doc.Init -Jobs Import, Import.platyPs, Doc.Init.Directory, {
New-MarkdownHelp -Module $ModuleName -OutputFolder $DocumentationDirectory -Force:$ForceDocInit -ErrorAction Continue
New-MarkdownHelp -Module $ModuleName -OutputFolder $DocumentationDirectory -Force:$ForceDocInit -ErrorAction Continue
}

# Synopsis: Update the markdown documentation.
task Doc.Update -Jobs Import, Import.platyPs, Doc.Init, {
Update-MarkdownHelp -Path $DocumentationDirectory
Update-MarkdownHelp -Path $DocumentationDirectory
}

task PreparePublishDirectory -If ( -Not ( Test-Path $PublishDirectory )) -Jobs {
Expand All @@ -50,32 +49,24 @@ task SetPrerelease -If $BuildNumber {
Update-ModuleManifest -Path $Global:Manifest -Prerelease $Global:PreRelease
}

# Synopsis: Set the functions to export in the manifest based on the directory structure.
task SetFunctionsToExport {
Update-ModuleManifest -Path $Global:Manifest -FunctionsToExport (
Get-ChildItem -Path $PublicFunctionsDirectory -Filter *.ps1 |
Select-Object -ExpandProperty BaseName
)
}

# Synopsis: Build the module.
task Build -Jobs Clean, Doc.Update, PreparePublishDirectory, {
Copy-Item -Path $SourceDirectory -Destination $ModulePublishDirectory -Recurse
[System.IO.FileInfo] $Global:Manifest = "$ModulePublishDirectory/$ModuleName.psd1"
}, SetPrerelease, SetFunctionsToExport
[System.IO.FileInfo] $Global:Manifest = "$ModulePublishDirectory/$ModuleName.psd1"
}, SetPrerelease

# Synopsis: Install the module.
task Install -Jobs Build, {
$info = Import-PowerShellDataFile $Global:Manifest
$version = ([System.Version] $info.ModuleVersion)
$info = Import-PowerShellDataFile $Global:Manifest
$version = ([System.Version] $info.ModuleVersion)
$defaultModulePath = $env:PSModulePath -split ';' | Select-Object -First 1
if ( -not $defaultModulePath ) {
Write-Error "Failed to determine default module path from `$env:PSModulePath='$( $env:PSModulePath )'"
}
if ( -not $defaultModulePath ) {
Write-Error "Failed to determine default module path from `$env:PSModulePath='$( $env:PSModulePath )'"
}
Write-Verbose "install $ModuleName $version to '$defaultModulePath'"
$installPath = Join-Path $defaultModulePath $ModuleName $version.ToString()
New-Item -Type Directory $installPath -Force | Out-Null
Get-ChildItem $Global:Manifest.Directory | Copy-Item -Destination $installPath -Recurse -Force
New-Item -Type Directory $installPath -Force | Out-Null
Get-ChildItem $Global:Manifest.Directory | Copy-Item -Destination $installPath -Recurse -Force
}

# Synopsis: Publish the module to PSGallery.
Expand Down

0 comments on commit cc06c71

Please sign in to comment.