Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate release date with ensmallen version #226

Merged
merged 8 commits into from
Oct 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
### ensmallen ?.??.?: "???"
###### ????-??-??

* Add release date to version information. ([#226](https://github.com/mlpack/ensmallen/pull/226))

### ensmallen 2.14.2: "No Direction Home"
###### 2020-08-31
* Fix implementation of fonesca fleming problem function f1 and f2
Expand Down
14 changes: 13 additions & 1 deletion include/ensmallen_bits/ens_version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
// (i.e. the version name will be "RC1", "RC2", etc.). Otherwise the version
// name will typically be a seemingly arbitrary set of words that does not
// contain the capitalized string "RC".
#define ENS_VERSION_NAME "No Direction Home"
#define ENS_VERSION_NAME "No Direction Home"
// Incorporate the date the version was released.
#define ENS_VERSION_YEAR "2020"
#define ENS_VERSION_MONTH "09"
#define ENS_VERSION_DAY "05"

namespace ens {

Expand All @@ -41,6 +45,14 @@ struct version

return ss.str();
}

static inline std::string date()
{
std::stringstream ss;
ss << ENS_VERSION_YEAR << '-' << ENS_VERSION_MONTH << '-' << ENS_VERSION_DAY;

return ss.str();
}
};

} // namespace ens
8 changes: 8 additions & 0 deletions scripts/ensmallen-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ new_line="ensmallen $MAJOR.$MINOR.$PATCH: \"$version_name\"";
sed -i "s/### ensmallen ?.??.?: \"???\"/### $new_line/" HISTORY.md;
sed -i "s/###### ????-??-??/###### $year-$month-$day/" HISTORY.md;

# Update date in ens_version.hpp
sed -i 's/ENS_VERSION_YEAR[ ]*\".*\"$/ENS_VERSION_YEAR \"'"$year"'\"/' \
include/ensmallen_bits/ens_version.hpp;
sed -i 's/ENS_VERSION_MONTH[ ]*\".*\"$/ENS_VERSION_MONTH \"'"$month"'\"/' \
include/ensmallen_bits/ens_version.hpp;
sed -i 's/ENS_VERSION_DAY[ ]*\".*\"$/ENS_VERSION_DAY \"'"$day"'\"/' \
include/ensmallen_bits/ens_version.hpp;

# Now, we'll do all this on a new release branch.
git checkout -b release-$MAJOR.$MINOR.$PATCH;

Expand Down