Commit d1d88dde authored by Dominik Charousset's avatar Dominik Charousset

Fix bug in make_release script w/ blog post

parent c1d3b4db
...@@ -108,7 +108,7 @@ with the developer blog checked out one level above, i.e.: ...@@ -108,7 +108,7 @@ with the developer blog checked out one level above, i.e.:
# assumed files # assumed files
token_path="$HOME/.github-oauth-token" token_path="$HOME/.github-oauth-token"
blog_msg="github_release_note.md" blog_msg="blog_release_note.md"
github_msg="github_release_note.md" github_msg="github_release_note.md"
config_hpp_path="libcaf_core/caf/config.hpp" config_hpp_path="libcaf_core/caf/config.hpp"
...@@ -116,16 +116,19 @@ config_hpp_path="libcaf_core/caf/config.hpp" ...@@ -116,16 +116,19 @@ config_hpp_path="libcaf_core/caf/config.hpp"
blog_posts_path="../blog/_posts" blog_posts_path="../blog/_posts"
# check whether all expected files and directories exist # check whether all expected files and directories exist
assert_exists "$token_path" "$config_hpp_path" "$blog_msg" "$github_msg" assert_exists "$token_path" "$config_hpp_path" "$github_msg"
# check for a clean state
assert_exists_not .make-release-steps.bash
assert_git_status_clean "." assert_git_status_clean "."
if [ ! -f "$blog_posts_path" ]; then if [ ! -f "$blog_msg" ]; then
ask_permission "blog_release_note.md missing, continue without blog post [y] or abort [n]?" ask_permission "$blog_msg missing, continue without blog post [y] or abort [n]?"
else else
# target files # target files
assert_exists "$blog_posts_path"
blog_target_file="$blog_posts_path/$(date +%F)-version-$1-released.md" blog_target_file="$blog_posts_path/$(date +%F)-version-$1-released.md"
assert_exists_not "$blog_target_file" .make-release-steps.bash assert_exists_not "$blog_target_file"
assert_git_status_clean "../blog/" assert_git_status_clean "../blog/"
fi fi
...@@ -134,7 +137,7 @@ fi ...@@ -134,7 +137,7 @@ fi
# II: two-digit (zero padded) minor version # II: two-digit (zero padded) minor version
# PP: two-digit (zero padded) patch version # PP: two-digit (zero padded) patch version
# but omit leading zeros # but omit leading zeros
version_str=$(echo "$1" | awk -F. '{ if ($1 > 0) printf("%d%02d%02d\n", $1, $2, $3); else printf("%02d%02d\n", $2, $3) }') version_str=$(echo "$1" | awk -F. '"{ if ($1 > 0) printf("%d%02d%02d\n", $1, $2, $3); else printf("%02d%02d\n", $2, $3) }')
echo ">>> patching config.hpp" echo ">>> patching config.hpp"
sed "s/#define CAF_VERSION [0-9]*/#define CAF_VERSION ${version_str}/g" < "$config_hpp_path" > .tmp_conf_hpp sed "s/#define CAF_VERSION [0-9]*/#define CAF_VERSION ${version_str}/g" < "$config_hpp_path" > .tmp_conf_hpp
...@@ -170,7 +173,7 @@ git checkout develop ...@@ -170,7 +173,7 @@ git checkout develop
curl --data '$github_json' https://api.github.com/repos/actor-framework/actor-framework/releases?access_token=$token curl --data '$github_json' https://api.github.com/repos/actor-framework/actor-framework/releases?access_token=$token
" > .make-release-steps.bash " > .make-release-steps.bash
if [ -f "$blog_posts_path" ]; then if [ -f "$blog_msg" ]; then
echo "\ echo "\
cp "$blog_msg" "$blog_target_file" cp "$blog_msg" "$blog_target_file"
cd ../blog cd ../blog
...@@ -192,7 +195,10 @@ chmod +x .make-release-steps.bash ...@@ -192,7 +195,10 @@ chmod +x .make-release-steps.bash
echo ; echo echo ; echo
echo ">>> cleaning up" echo ">>> cleaning up"
rm "$blog_msg" "$github_msg" .make-release-steps.bash rm "$github_msg" .make-release-steps.bash
if [ -f "$blog_msg" ]; then
rm "$blog_msg"
fi
echo ; echo echo ; echo
echo ">>> done" echo ">>> done"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment