Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
Expand Down Expand Up @@ -120,15 +121,15 @@ jobs:
- name: Create ZIP archive (Windows)
if: matrix.os == 'windows-latest'
run: |
Compress-Archive -Path bin\gomailtest${{ matrix.ext }},README.md,IMAPTOOL_README.md,JMAPTOOL_README.md,MSGRAPHTOOL_README.md,POP3TOOL_README.md,SMTP_TOOL_README.md,EXAMPLES.md,LICENSE -DestinationPath ${{ matrix.zip_name }}
Compress-Archive -Path bin\gomailtest${{ matrix.ext }},README.md,TOOLS.md,EXAMPLES.md,LICENSE -DestinationPath ${{ matrix.zip_name }}
Write-Host "Created ZIP archive: ${{ matrix.zip_name }}"
Get-Item ${{ matrix.zip_name }} | Select-Object Name, Length

- name: Create ZIP archive (Linux/macOS)
if: matrix.os != 'windows-latest'
run: |
cd bin && zip ../${{ matrix.zip_name }} gomailtest${{ matrix.ext }} && cd ..
zip -u ${{ matrix.zip_name }} README.md IMAPTOOL_README.md JMAPTOOL_README.md MSGRAPHTOOL_README.md POP3TOOL_README.md SMTP_TOOL_README.md EXAMPLES.md LICENSE
zip -u ${{ matrix.zip_name }} README.md TOOLS.md EXAMPLES.md LICENSE
echo "Created ZIP archive: ${{ matrix.zip_name }}"
ls -lh ${{ matrix.zip_name }}

Expand All @@ -154,7 +155,7 @@ jobs:

Plus documentation:
- **README.md** - Main documentation
- ** *_TOOL_README.md** - specific protocols tool guide
- **TOOLS.md** - Protocol-specific tool guides
- **EXAMPLES.md** - Usage examples
- **LICENSE** - MIT License

Expand Down
5 changes: 5 additions & 0 deletions ChangeLog/3.1.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 3.1.5 — 2026-04-12

## Added
- fighting with build on GitHub action

69 changes: 9 additions & 60 deletions build-all.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# Builds the unified gomailtest binary (optimized)

param(
[switch]$Verbose,
[switch]$SkipTests
[switch]$Verbose
)

$ErrorActionPreference = "Stop"
Expand All @@ -24,73 +23,23 @@ Write-ColorOutput "════════════════════

# Ensure bin directory exists
$binDir = Join-Path $PSScriptRoot "bin"
if (-not (Test-Path $binDir)) {
New-Item -ItemType Directory -Path $binDir | Out-Null
Write-ColorOutput "Created bin/ directory`n" "Yellow"
}
New-Item -ItemType Directory -Path $binDir -Force | Out-Null

# Read version from version.go
$versionFile = Join-Path $PSScriptRoot "internal" "common" "version" "version.go"
if (-not (Test-Path $versionFile)) {
Write-ColorOutput "ERROR: version.go not found at $versionFile" "Red"
exit 1
}
$versionContent = Get-Content $versionFile -Raw
if ($versionContent -match 'const Version = "([^"]+)"') {
$version = $matches[1]
} else {
Write-ColorOutput "ERROR: Could not extract version from version.go" "Red"
exit 1
}
Write-ColorOutput "Version: $version`n" "Yellow"
$version = (Select-String -Path (Join-Path $PSScriptRoot "internal/common/version/version.go") -Pattern 'Version = "([^"]+)"').Matches[0].Groups[1].Value

# Build gomailtest
Write-ColorOutput "Building gomailtest..." "Cyan"

$outputFile = Join-Path $binDir "gomailtest.exe"

try {
if ($Verbose) {
go build -v -ldflags="-s -w" -o $outputFile ./cmd/gomailtest
} else {
go build -ldflags="-s -w" -o $outputFile ./cmd/gomailtest
}

if ($LASTEXITCODE -eq 0) {
$size = (Get-Item $outputFile).Length / 1MB
Write-ColorOutput " ✓ Build successful (Size: $($size.ToString('N2')) MB)" "Green"
} else {
throw "Build failed with exit code $LASTEXITCODE"
}
} catch {
Write-ColorOutput " ✗ Build failed: $_" "Red"
exit 1
if ($Verbose) {
go build -v -ldflags="-s -w" -o $outputFile ./cmd/gomailtest
} else {
go build -ldflags="-s -w" -o $outputFile ./cmd/gomailtest
}

# Run version check (optional)
if (-not $SkipTests) {
Write-ColorOutput "`nVerifying version..." "Cyan"
$toolVersion = & $outputFile --version 2>&1
if ($toolVersion -match $version) {
Write-ColorOutput " ✓ Version correct: $version" "Green"
} else {
Write-ColorOutput " ⚠ Version mismatch (expected: $version, got: $toolVersion)" "Yellow"
}
}
Write-ColorOutput " Built bin/gomailtest.exe — version $version" "Green"

# Summary
Write-ColorOutput "`n═══════════════════════════════════════════════════════════" "Cyan"
Write-ColorOutput " Build Complete!" "Green"
Write-ColorOutput "═══════════════════════════════════════════════════════════" "Cyan"

Write-ColorOutput "`nBuilt executable: bin\gomailtest.exe" "White"

Write-ColorOutput "`nUsage examples:" "Yellow"
Write-ColorOutput " .\bin\gomailtest.exe --version" "Gray"
Write-ColorOutput " .\bin\gomailtest.exe smtp testconnect --host smtp.example.com --port 25" "Gray"
Write-ColorOutput " .\bin\gomailtest.exe imap testconnect --host imap.gmail.com --imaps" "Gray"
Write-ColorOutput " .\bin\gomailtest.exe pop3 testconnect --host pop.gmail.com --pop3s" "Gray"
Write-ColorOutput " .\bin\gomailtest.exe jmap testconnect --host jmap.fastmail.com" "Gray"
Write-ColorOutput " .\bin\gomailtest.exe msgraph getevents`n" "Gray"

Write-ColorOutput "For more information, see README.md and docs/protocols/`n" "Cyan"
Write-ColorOutput "═══════════════════════════════════════════════════════════`n" "Cyan"
2 changes: 1 addition & 1 deletion internal/common/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package version
// 1. Change the Version constant below
// 2. Create a changelog entry in ChangeLog/{version}.md
// 3. Commit with message: "Bump version to {version}"
const Version = "3.1.1"
const Version = "3.1.6"

// Get returns the current version string.
// This is a convenience function for accessing the Version constant.
Expand Down
Loading