Utility Powershell script - addon zipper with versioning

Build Blender addon zip file with versioning (github.com):

Also here, in case the link ever breaks:

$versionList = Select-String -Path ".\path-to-addon\__init__.py" -Pattern '"version":\s*\((\d+)\D*(\d+)\D*(\d+)\)'
$majorVersion = $versionList.Matches.Groups[1].Value
$minorVersion = $versionList.Matches.Groups[2].Value
$patchVersion = $versionList.Matches.Groups[3].Value

Get-ChildItem -Path "." -Directory | Where-Object BaseName -eq "addon-name" | Compress-Archive -DestinationPath ".\addon-name-$majorVersion-$minorVersion-$patchVersion.zip"

This Powershell script will get the version of your addon via bl_info (such as (1, 3, 13)) and use it in the zip file name, addon-name-1-3-13.zip. I’ve found it useful when building and delivering the zip file for addons.

Note: you may need to update your user’s Powershell execution policy to run it, see Set-ExecutionPolicy in Microsoft Docs for how to change that.