Skip to content

Commit

Permalink
add root folder name
Browse files Browse the repository at this point in the history
  • Loading branch information
james-garriss committed Dec 24, 2024
1 parent 158cd49 commit 71842f1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build_sign_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ jobs:
New-ModuleSignature `
-AzureKeyVaultUrl ${{ steps.key-vault-info.outputs.KeyVaultUrl }} `
-CertificateName ${{ steps.key-vault-info.outputs.KeyVaultCertificateName }} `
-ReleaseVersion ${{ inputs.version }}
-ReleaseVersion ${{ inputs.version }} `
-RootFolderName "root"
- name: Create Release
uses: softprops/action-gh-release@v1
id: create-release
Expand Down
5 changes: 3 additions & 2 deletions Testing/workflow/Build-SignRelease.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ Describe "Sign Module Check" {
$ScriptPath = Join-Path -Path $PSScriptRoot -ChildPath '../../utils/workflow/Build-SignRelease.ps1' -Resolve
# Source the function
. $ScriptPath

$RootFolderName = Join-Path -Path $PSScriptRoot -Childpath '../..'
New-ModuleSignature `
-AzureKeyVaultUrl "https://www.cisa.gov" `
-CertificateName "certificate name" `
-ReleaseVersion "0.0.1"
-ReleaseVersion "0.0.1" `
-RootFolderName $RootFolderName
}

}
2 changes: 1 addition & 1 deletion Testing/workflow/Install-AzureSignTool.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The purpose of this test is to verify that Azure Sign Tool is working.

BeforeDiscovery {
$ScriptPath = Join-Path -Path $PSScriptRoot -ChildPath '../../utils/workflow/Install-AzureSignTool.ps1.ps1' -Resolve
$ScriptPath = Join-Path -Path $PSScriptRoot -ChildPath '../../utils/workflow/Install-AzureSignTool.ps1' -Resolve
# Source the function
. $ScriptPath
Install-AzureSignTool
Expand Down
13 changes: 9 additions & 4 deletions utils/workflow/Build-SignRelease.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ function New-ModuleSignature {
The name of the certificate stored in the KeyVault.
.PARAMETER $ReleaseVersion
The version number of the release (e.g., 1.5.1).
.PARAMETER $RootFolderName
The name of the root folder.
#>
[CmdletBinding()]
param(
Expand All @@ -19,7 +21,10 @@ function New-ModuleSignature {
$CertificateName,
[Parameter(Mandatory = $true)]
[string]
$ReleaseVersion
$ReleaseVersion,
[Parameter(Mandatory = $true)]
[string]
$RootFolderName
)

Write-Warning "Signing the module with AzureSignTool..."
Expand All @@ -29,10 +34,10 @@ function New-ModuleSignature {
. $PublishPath

# Remove non-release files (required for non-Windows machines)
Remove-Item -Recurse -Force repo -Include .git*
Remove-Item -Recurse -Force $RootFolderName -Include .git*
Write-Warning "Creating an array of the files to sign..."
$ArrayOfFilePaths = New-ArrayOfFilePaths `
-ModuleDestinationPath repo
-ModuleDestinationPath $RootFolderName

Write-Warning "Creating a file with a list of the files to sign..."
$FileListFileName = New-FileList `
Expand All @@ -43,6 +48,6 @@ function New-ModuleSignature {
-AzureKeyVaultUrl $AzureKeyVaultUrl `
-CertificateName $CertificateName `
-FileList $FileListFileName
Move-Item -Path repo -Destination "ScubaGear-$ReleaseVersion" -Force
Move-Item -Path $RootFolderName -Destination "ScubaGear-$ReleaseVersion" -Force
Compress-Archive -Path "ScubaGear-$ReleaseVersion" -DestinationPath "ScubaGear-$ReleaseVersion.zip"
}

0 comments on commit 71842f1

Please sign in to comment.