-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version-checking release script (#27)
* bin/check-version * add release script
- Loading branch information
Showing
4 changed files
with
48 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
desired="$1" | ||
pattern='^v[0-9]\+\.[0-9]\.[0-9]\+$' | ||
if echo "$desired" | grep -v "$pattern" >/dev/null 2>&1; then | ||
>&2 echo "Specified version \"$desired\" does not match the grep pattern $pattern" | ||
exit 1 | ||
fi | ||
|
||
scratch=$(mktemp -d) | ||
version_cpp="$(dirname "$0")/../src/datadog/version.cpp" | ||
cp "$version_cpp" "$scratch" | ||
cp "${version_cpp%.cpp}.h" "$scratch" | ||
>"$scratch/print_version.cpp" cat <<'END_CPP' | ||
#include "version.h" | ||
#include <iostream> | ||
int main() { | ||
std::cout << datadog::tracing::tracer_version; | ||
} | ||
END_CPP | ||
|
||
/usr/bin/c++ -o "$scratch/print_version" "$scratch"/*.cpp | ||
actual=$("$scratch/print_version") | ||
rm -r "$scratch" | ||
|
||
if [ "$actual" != "$desired" ]; then | ||
version_cpp="$(realpath --relative-to="$(pwd)" "$version_cpp")" | ||
>&2 echo "Desired release version \"$desired\" is different from that in $version_cpp: \"$actual\"" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
version="$1" | ||
bin="$(dirname "$0")" | ||
"$bin"/check-version "$version" || exit | ||
gh release create "$version" --prerelease --draft |
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