Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
a6f86a48
Commit
a6f86a48
authored
Sep 30, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add script for making CAF releases
parent
b9415584
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
191 additions
and
0 deletions
+191
-0
.gitignore
.gitignore
+3
-0
scripts/make_release.bash
scripts/make_release.bash
+188
-0
No files found.
.gitignore
View file @
a6f86a48
...
@@ -13,3 +13,6 @@ manual
...
@@ -13,3 +13,6 @@ manual
bii/*
bii/*
libcaf_core/caf/detail/build_config.hpp
libcaf_core/caf/detail/build_config.hpp
.ycm_extra_conf.pyc
.ycm_extra_conf.pyc
blog_release_note.md
github_release_note.md
.make-release-steps.bash
scripts/make_release.bash
0 → 100755
View file @
a6f86a48
#!/bin/bash
# exit on first error
set
-e
usage_string
=
"
\
Usage:
$0
VERSION
"
function
usage
()
{
echo
"
$usage_string
"
exit
}
function
raise_error
()
{
echo
"***
$1
"
1>&2
exit
}
function
file_ending
()
{
echo
$(
basename
"
$1
"
|
awk
-F
'.'
'{if (NF > 1) print $NF}'
)
}
function
assert_exists
()
{
while
[
$#
-gt
0
]
;
do
if
[
-z
"
$(
file_ending
"
$1
"
)
"
]
;
then
# assume directory for paths without file ending
if
[
!
-d
"
$1
"
]
;
then
raise_error
"directory
$1
missing"
fi
else
if
[
!
-f
"
$1
"
]
;
then
raise_error
"file
$1
missing"
fi
fi
shift
done
}
function
assert_exists_not
()
{
while
[
$#
-gt
0
]
;
do
if
[
-e
"
$1
"
]
;
then
raise_error
"file
$1
already exists"
fi
shift
done
}
function
assert_git_status_clean
()
{
# save current directory
anchor
=
"
$PWD
"
cd
"
$1
"
# check for untracked files
untracked_files
=
$(
git ls-files
--others
--exclude-standard
)
if
[
-n
"
$untracked_files
"
]
;
then
raise_error
"
$1
contains untracked files"
fi
# check Git status
if
[
-n
"
$(
git status
--porcelain
)
"
]
;
then
raise_error
"
$1
is not in a clean state (see git status)"
fi
# restore directory
cd
"
$anchor
"
}
function
ask_permission
()
{
yes_or_no
=
""
while
[
"
$yes_or_no
"
!=
"n"
]
&&
[
"
$yes_or_no
"
!=
"y"
]
;
do
echo
">>>
$1
"
read
yes_or_no
done
if
[
"
$yes_or_no
"
=
"n"
]
;
then
raise_error
"aborted"
fi
}
if
[
$#
-ne
1
]
;
then
usage
fi
echo
"
\
____ _ _____
/ ___| /
\
| ___| C++
| | / _
\
| |_ Actor
| |___ / ___
\|
_| Framework
\_
___/_/
\_
|_|
This script expects to run at the root directory of a Git clone of CAF.
The current repository must be develop, there must be no untracked file,
and the working tree status must be equal to the current HEAD commit.
Further, the script expects a relase_note.md file in the current directory
with the developer blog checked out one level above, i.e.:
\$
HOME
├── .github-oauth-token
.
├── libcaf_io
├── blog_release_note.md
├── github_release_note.md
..
├── blog
│ ├── _posts
"
# assumed files
token_path
=
"
$HOME
/.github-oauth-token"
blog_msg
=
"github_release_note.md"
github_msg
=
"github_release_note.md"
config_hpp_path
=
"libcaf_core/caf/config.hpp"
# assumed directories
blog_posts_path
=
"../blog/_posts"
# check whether all expected files and directories exist
assert_exists
"
$token_path
"
"
$config_hpp_path
"
"
$blog_msg
"
"
$github_msg
"
"
$blog_posts_path
"
# target files
blog_target_file
=
"
$blog_posts_path
/
$(
date
+%F
)
-version-
$1
-released.md"
assert_exists_not
"
$blog_target_file
"
.make-release-steps.bash
assert_git_status_clean
"."
assert_git_status_clean
"../blog/"
# convert major.minor.patch version given as first argument into JJIIPP with:
# JJ: two-digit (zero padded) major version
# II: two-digit (zero padded) minor version
# PP: two-digit (zero padded) patch version
# 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) }'
)
echo
">>> patching config.hpp"
sed
"s/#define CAF_VERSION [0-9]*/#define CAF_VERSION
${
version_str
}
/g"
<
"
$config_hpp_path
"
>
.tmp_conf_hpp
mv
.tmp_conf_hpp
"
$config_hpp_path
"
echo
;
echo
echo
">>> please review the diff reported by Git for patching config.hpp:"
git diff
echo
;
echo
ask_permission
"type [n] to abort or [y] for commiting and pushing it"
# piping through AWK/printf makes sure 0.15 is expanded to 0.15.0
tag_version
=
$(
echo
"
$1
"
|
awk
-F
.
'{ printf("%d.%d.%d", $1, $2, $3) }'
)
token
=
$(
cat
"
$token_path
"
)
tag_descr
=
$(
awk
1
ORS
=
'\\r\\n'
"
$github_msg
"
)
github_json
=
$(
printf
'{"tag_name": "%s","name": "%s","body": "%s","draft": false,"prerelease": false}'
"
$tag_version
"
"
$tag_version
"
"
$tag_descr
"
)
# for returning to this directory after pushing blog
anchor
=
"
$PWD
"
echo
"
\
#!/bin/bash
set -e
git commit -a -m
\"
Change version to
$1
\"
git push
git checkout master
git merge develop
git tag
$tag_version
git push origin --tags
git checkout develop
curl --data '
$github_json
' https://api.github.com/repos/actor-framework/actor-framework/releases?access_token=
$token
cp "
$blog_msg
" "
$blog_target_file
"
cd ../blog
git add _posts
git commit -m
\"
$1
announcement
\"
git push
cd "
$anchor
"
"
>
.make-release-steps.bash
echo
;
echo
echo
">>> please review the final steps for releasing
$1
"
cat
.make-release-steps.bash
echo
;
echo
ask_permission
"type [y] to execute the steps above or [n] to abort"
chmod
+x .make-release-steps.bash
./.make-release-steps.bash
echo
;
echo
echo
">>> cleaning up"
rm
"
$blog_msg
"
"
$github_msg
"
.make-release-steps.bash
echo
;
echo
echo
">>> done"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment