How to keep repository with custom CLI tool version and GitHub releases in-sync?

Hi!

I would like to distribute command line tool for swift ( swift [name] [arguments] ). I looked at various swift repositories at Apple and I couldn't find common way to provide version of tool.

swift build my_tool && swift my_tool --version // version 1.2.3

This version doesn't belong to Package.swift and it can't be hardcoded into source. I would like to add VERSION file in root directory.

But I should also add make_release.sh script, which bumps version and add release tag.

Is it a good solution for swift cli tools?