Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Determine version dynamically from git
Ship a ./version file so that this also works when building from dist tarballs. Add a little helper shell script to determine this. This enables us to reduce the release process to merely pushing a signed tag.
- Loading branch information
1 parent
23a842d
commit cf0d7b4
Showing
7 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
.deps | ||
.dirstamp | ||
.libs | ||
.version | ||
*.la | ||
*.lo | ||
*.o | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
ROOT=$(dirname $(dirname $(realpath "$0"))) | ||
if [ -n "${MESON_SOURCE_ROOT:-}/.git" ] && VER=$(git -C "$MESON_SOURCE_ROOT" describe); then | ||
# make version number distribution friendly | ||
VER=$(echo "$VER" | sed 's/-/./g') | ||
# when invoked as dist script, write the stamp; this is false when invoked from project.version() | ||
[ -z "${MESON_DIST_ROOT:-}" ] || echo "$VER" > "${MESON_DIST_ROOT}/.version" | ||
echo "$VER" | ||
# when invoked from a tarball, it should be in the source root | ||
elif [ -e "${ROOT}/.version" ]; then | ||
cat "${ROOT}/.version" | ||
else | ||
echo "ERROR: Neither a git checkout nor .version, cannot determine version" >&2 | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters