Updates the CI script to improve version retrieval and checking logic.
Replaces direct calls to the VERSION file with reading from a
`.version` JSON file, ensuring proper version management. Handles
the creation and updating of the CHANGELOG and .version files to
enhance the release process. Adjusts conditions for executing
release tasks based on current tags and branches to prevent
unnecessary executions.