Skip to content

Commit

Permalink
Fix module build process (#844)
Browse files Browse the repository at this point in the history
* Update automated-publish.yaml

* Update build.ps1

* Update build.ps1

* Update automated-publish.yaml

* Update EnterprisePolicyAsCode.prerelease.psd1
  • Loading branch information
anwather authored Jan 7, 2025
1 parent 041556b commit 4d02c21
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/automated-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ jobs:
Install-Module Az.ResourceGraph -Force
.\Module\build.ps1
Publish-Module -Path .\Module\EnterprisePolicyAsCode -NuGetApiKey $env:APIKEY -Verbose
2 changes: 1 addition & 1 deletion Module/EnterprisePolicyAsCode.prerelease.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# Tags = @()

# Prerelease tag to append
Prerelease = ''
Prerelease = ''

# A URL to the license for this module.
LicenseUri = 'https://github.com/Azure/enterprise-azure-policy-as-code/blob/main/LICENSE'
Expand Down
3 changes: 2 additions & 1 deletion Module/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ if ($isPreRelease) {
$version = ($tag_name -split "-")[0]
$prereleaseString = ($tag_name -split "-")[1]
(Get-Content -Path .\Module\EnterprisePolicyAsCode\EnterprisePolicyAsCode.psd1) -replace "ModuleVersion = ''", "ModuleVersion = '$version'" | Set-Content .\Module\EnterprisePolicyAsCode\EnterprisePolicyAsCode.psd1
(Get-Content -Path .\Module\EnterprisePolicyAsCode\EnterprisePolicyAsCode.psd1) -replace "Prerelease = ''", "Prerelease = '$prereleaseString'" | Set-Content .\Module\EnterprisePolicyAsCode\EnterprisePolicyAsCode.psd1
(Get-Content -Path .\Module\EnterprisePolicyAsCode\EnterprisePolicyAsCode.psd1) -replace "Prerelease = ''", "Prerelease = '$prereleaseString'" | Set-Content .\Module\EnterprisePolicyAsCode\EnterprisePolicyAsCode.psd1
Get-Content -Path .\Module\EnterprisePolicyAsCode\EnterprisePolicyAsCode.psd1
}
else {
(Get-Content -Path .\Module\EnterprisePolicyAsCode\EnterprisePolicyAsCode.psd1) -replace "ModuleVersion = ''", "ModuleVersion = '$tag_name'" | Set-Content .\Module\EnterprisePolicyAsCode\EnterprisePolicyAsCode.psd1
Expand Down

0 comments on commit 4d02c21

Please sign in to comment.