Skip to content

Commit 7f10fb1

Browse files
committed
Refactor structure
1 parent adea8e3 commit 7f10fb1

27 files changed

+308
-130537
lines changed

.github/workflows/publish-powershell-module-psg.yml renamed to .github/workflows/powershell-publish-gallery-module.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
name: "Main"
1313
uses: "hugoalh/hugoalh/.github/workflows/call-powershell-publish-gallery-module-0.yml@main"
1414
with:
15+
builder: "_build-package.ps1"
1516
path: ".\\hugoalh.GitHubActionsToolkit\\"
1617
secrets:
1718
POWERSHELLGALLERY_TOKEN: "${{secrets.POWERSHELLGALLERY_TOKEN}}"

_build-package.ps1

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#Requires -PSEdition Core -Version 7.2
2+
<#
3+
This script is help for build package.
4+
#>
5+
Param (
6+
[Switch]$SkipNodeJSModules
7+
)
8+
$ErrorActionPreference = 'Stop'
9+
[String]$PackageRoot = Join-Path -Path $PSScriptRoot -ChildPath 'hugoalh.GitHubActionsToolkit'
10+
[String]$PackageWrapperRoot = Join-Path -Path $PackageRoot -ChildPath 'nodejs-wrapper'
11+
$OriginalLocation = Get-Location
12+
Set-Location -LiteralPath $PSScriptRoot
13+
npm run wrapper-transform
14+
@(
15+
@{
16+
Destination = 'LICENSE.md'
17+
Source = 'LICENSE.md'
18+
},
19+
@{
20+
Destination = Join-Path -Path 'nodejs-wrapper' -ChildPath 'package-lock.json'
21+
Source = 'package-lock.json'
22+
},
23+
@{
24+
Destination = Join-Path -Path 'nodejs-wrapper' -ChildPath 'package.json'
25+
Source = 'package.json'
26+
}
27+
) |
28+
ForEach-Object -Process {
29+
Copy-Item -LiteralPath (Join-Path -Path $PSScriptRoot -ChildPath $_.Source) -Destination (Join-Path -Path $PackageRoot -ChildPath $_.Destination) -Recurse -Confirm:$False
30+
}
31+
If (!$SkipNodeJSModules.IsPresent) {
32+
Set-Location -LiteralPath $PackageWrapperRoot
33+
npm install --ignore-scripts --omit dev
34+
}
35+
Set-Location -LiteralPath $OriginalLocation

_get-package-members.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<#
33
This script is help for copy members to the file `hugoalh.GitHubActionsToolkit.psd1` for best performance, and use for debug.
44
#>
5+
$ErrorActionPreference = 'Stop'
56
[String]$PackageName = 'hugoalh.GitHubActionsToolkit'
67
Import-Module -Name @(
78
(Join-Path -Path $PSScriptRoot -ChildPath "$PackageName\$PackageName.psm1")

bundler.mjs

Lines changed: 0 additions & 35 deletions
This file was deleted.

hugoalh.GitHubActionsToolkit/LICENSE.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
)
1717
Import-Module -Name (
1818
$ModulesName |
19-
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "module\$_.psm1" }
19+
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "lib\$_.psm1" }
2020
) -Scope 'Local'
2121
[PSCustomObject[]]$PackageCommands = Get-Command -Module $ModulesName -ListImported
2222
[String[]]$PackageFunctions = $PackageCommands |

hugoalh.GitHubActionsToolkit/module/artifact.psm1 renamed to hugoalh.GitHubActionsToolkit/lib/artifact.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Requires -PSEdition Core -Version 7.2
22
Import-Module -Name @(
3-
(Join-Path -Path $PSScriptRoot -ChildPath 'internal\nodejs-wrapper.psm1')
3+
(Join-Path -Path $PSScriptRoot -ChildPath 'nodejs-wrapper.psm1')
44
) -Prefix 'GitHubActions' -Scope 'Local'
55
<#
66
.SYNOPSIS

hugoalh.GitHubActionsToolkit/module/cache.psm1 renamed to hugoalh.GitHubActionsToolkit/lib/cache.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Requires -PSEdition Core -Version 7.2
22
Import-Module -Name @(
3-
(Join-Path -Path $PSScriptRoot -ChildPath 'internal\nodejs-wrapper.psm1')
3+
(Join-Path -Path $PSScriptRoot -ChildPath 'nodejs-wrapper.psm1')
44
) -Prefix 'GitHubActions' -Scope 'Local'
55
<#
66
.SYNOPSIS

0 commit comments

Comments
 (0)