Skip to content

Commit 528afbb

Browse files
chore(build): ✨ Add packaging/publish scripts and bump VersionPrefix to 2.0.1
* Add build helpers: * `Build/Build-Package.ps1` * `Build/Publish-PackageGitHub.ps1` * `Build/Publish-PackageNuget.ps1` * `Build/Update-Version.ps1` * Remove legacy `Build/UpdateVersion.ps1` (DnsClientX leftover). * Bump `<VersionPrefix>` to `2.0.1` in: * `Sources/Mailozaurr/Mailozaurr.csproj` * `Sources/Mailozaurr.PowerShell/Mailozaurr.PowerShell.csproj`
1 parent 2589e9c commit 528afbb

File tree

11 files changed

+59
-108
lines changed

11 files changed

+59
-108
lines changed

Build/Build-Package.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Clear-Host
2+
3+
Invoke-DotNetReleaseBuild -ProjectPath "$PSScriptRoot\..\Sources\Mailozaurr" -CertificateThumbprint '483292C9E317AA13B07BB7A96AE9D1A5ED9E7703'

Build/BuildPackage.ps1

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

Build/Publish-PackageGitHub.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
$GitHubAccessToken = Get-Content -Raw 'C:\Support\Important\GithubAPI.txt'
2+
3+
$publishGitHubReleaseAssetSplat = @{
4+
ProjectPath = "$PSScriptRoot\..\Sources\Mailozaurr"
5+
GitHubAccessToken = $GitHubAccessToken
6+
GitHubUsername = "EvotecIT"
7+
GitHubRepositoryName = "Mailozaurr"
8+
IsPreRelease = $false
9+
}
10+
11+
Publish-GitHubReleaseAsset @publishGitHubReleaseAssetSplat

Build/Publish-PackageNuget.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Import-Module PSPublishModule -Force -ErrorAction Stop
2+
3+
$NugetAPI = Get-Content -Raw -LiteralPath "C:\Support\Important\NugetOrgEvotec.txt"
4+
Publish-NugetPackage -Path "$PSScriptRoot\..\Sources\Mailozaurr\bin\Release" -ApiKey $NugetAPI

Build/PublishPackage.ps1

Lines changed: 0 additions & 13 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
[CmdletBinding()]
2-
param(
3-
[string]$OutputPath = (Join-Path $PSScriptRoot '..\Sources\Mailozaurr\Resources')
4-
)
5-
6-
$lists = @{
7-
'disposable_email_blocklist.conf' = 'https://raw.githubusercontent.com/disposable-email-domains/disposable-email-domains/refs/heads/main/disposable_email_blocklist.conf'
8-
'allowlist.conf' = 'https://raw.githubusercontent.com/disposable-email-domains/disposable-email-domains/refs/heads/main/allowlist.conf'
9-
}
10-
11-
foreach ($list in $lists.GetEnumerator()) {
12-
$target = Join-Path $OutputPath $list.Key
13-
Write-Host "Checking $($list.Key)..."
14-
$remoteContent = (Invoke-WebRequest -Uri $list.Value -UseBasicParsing).Content -replace "`r`n", "`n" -split "`n" | Where-Object { $_ -and -not $_.StartsWith('#') }
15-
if (Test-Path $target) {
16-
$localContent = Get-Content $target
17-
$diff = Compare-Object -ReferenceObject $localContent -DifferenceObject $remoteContent
18-
if ($diff) {
19-
Write-Host "Changes for $($list.Key):"
20-
foreach ($d in $diff) {
21-
if ($d.SideIndicator -eq '=>') { Write-Host "Added: $($d.InputObject)" }
22-
elseif ($d.SideIndicator -eq '<=') { Write-Host "Removed: $($d.InputObject)" }
23-
}
24-
} else {
25-
Write-Host "No changes for $($list.Key)."
26-
}
27-
} else {
28-
Write-Host "Local file for $($list.Key) not found. Creating new."
29-
foreach ($line in $remoteContent) { Write-Host "Added: $line" }
30-
}
31-
$remoteContent | Set-Content $target -Encoding UTF8
32-
}
1+
[CmdletBinding()]
2+
param(
3+
[string]$OutputPath = (Join-Path $PSScriptRoot '..\Sources\Mailozaurr\Resources')
4+
)
5+
6+
$lists = @{
7+
'disposable_email_blocklist.conf' = 'https://raw.githubusercontent.com/disposable-email-domains/disposable-email-domains/refs/heads/main/disposable_email_blocklist.conf'
8+
'allowlist.conf' = 'https://raw.githubusercontent.com/disposable-email-domains/disposable-email-domains/refs/heads/main/allowlist.conf'
9+
}
10+
11+
foreach ($list in $lists.GetEnumerator()) {
12+
$target = Join-Path $OutputPath $list.Key
13+
Write-Host "Checking $($list.Key)..."
14+
$remoteContent = (Invoke-WebRequest -Uri $list.Value -UseBasicParsing).Content -replace "`r`n", "`n" -split "`n" | Where-Object { $_ -and -not $_.StartsWith('#') }
15+
if (Test-Path $target) {
16+
$localContent = Get-Content $target
17+
$diff = Compare-Object -ReferenceObject $localContent -DifferenceObject $remoteContent
18+
if ($diff) {
19+
Write-Host "Changes for $($list.Key):"
20+
foreach ($d in $diff) {
21+
if ($d.SideIndicator -eq '=>') { Write-Host "Added: $($d.InputObject)" }
22+
elseif ($d.SideIndicator -eq '<=') { Write-Host "Removed: $($d.InputObject)" }
23+
}
24+
} else {
25+
Write-Host "No changes for $($list.Key)."
26+
}
27+
} else {
28+
Write-Host "Local file for $($list.Key) not found. Creating new."
29+
foreach ($line in $remoteContent) { Write-Host "Added: $line" }
30+
}
31+
$remoteContent | Set-Content $target -Encoding UTF8
32+
}

Build/Update-Version.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Import-Module PSPublishModule -Force
2+
3+
Get-ProjectVersion -Path "C:\Support\GitHub\Mailozaurr\Sources" -ExcludeFolders @('C:\Support\GitHub\Mailozaurr\Module\Artefacts') | Format-Table
4+
5+
Set-ProjectVersion -Path "C:\Support\GitHub\Mailozaurr\Sources" -NewVersion "2.0.1" -Verbose -ExcludeFolders @('C:\Support\GitHub\Mailozaurr\Module\Artefacts') #-WhatIf

Build/UpdateVersion.ps1

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

Build/UploadGithub.ps1

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

Sources/Mailozaurr.PowerShell/Mailozaurr.PowerShell.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Company>Evotec</Company>
55
<Authors>Przemyslaw Klys</Authors>
6-
<VersionPrefix>2.0.0</VersionPrefix>
6+
<VersionPrefix>2.0.1</VersionPrefix>
77
<TargetFrameworks>net472;netstandard2.0;net8.0</TargetFrameworks>
88
<AssemblyName>Mailozaurr.PowerShell</AssemblyName>
99
<Nullable>enable</Nullable>

0 commit comments

Comments
 (0)