Thanks for the report. Seems like a bug. Tracking it here. As a workaround, please move export VERSION to after_build or build_script script or any other stage which happens earlier than deployment. Also I would recommend adding echo $VERSION after export VERSION to ensure value is OK.
I think that the problem rely on me trying to use sh scrips on a windows build, i was expecting to being processed using git bash or WSL, but in fact they're ignored at all. By replacing them with proper batch commands everything worked properly