Make epub archive using 7zip command line utility in PowerShell.
$source = ".\ebook"
$epub = ".\ebook.epub"
$source = (Resolve-Path $source -ErrorAction Stop).Path
Move-Item "${source}\mimetype" ".mimetype" -ErrorAction Stop
Remove-Item "$epub" -ErrorAction Ignore
& 7za a -mx0 "$epub" ".mimetype"
& 7za a -mx5 "$epub" "${source}\*"
& 7za rn "$epub" ".mimetype" "mimetype"
Move-Item ".mimetype" "${source}\mimetype"
For more robust script see build-epub.ps1
Or my Python script make-epub.py