The issue was with semantic-release (python) which didn't handle Twine uploads anymore.
I removed the the release-package script from semantic-release flow and added as an independent step after semantic-release version
instruction.
The script is now executed within the correct context and picks up global variables.