forked from A1mDev/hlstatsx-community-edition
-
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.
- Loading branch information
1 parent
7a022e5
commit 95561ba
Showing
5 changed files
with
79 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/sh | ||
# This script makes it easy to create a new release. | ||
# It requires git, which is only used to detect the previous tag. | ||
|
||
set -eu | ||
|
||
TAG=${1:-} | ||
COMMENT=${2:-} | ||
if [ -z "$TAG" ]; then | ||
echo "Please specify a tag as a first argument. E.g. v1.2.3" | ||
exit 1 | ||
fi | ||
TAG_REGEX='^v?[0-9]+\.[0-9]+\.[0-9]+$' | ||
if ! echo "$TAG" | grep -E "$TAG_REGEX" > /dev/null; then | ||
echo "Tag does not match regex: $TAG_REGEX" | ||
exit 1 | ||
fi | ||
TAG_PREV=$( git --no-pager tag -l --sort=-version:refname | head -n1 ) | ||
if ! echo "$TAG_PREV" | grep -E "$TAG_REGEX" > /dev/null; then | ||
echo "Previous git tag is invalid. It does not match regex: $TAG_REGEX" | ||
exit 1 | ||
fi | ||
|
||
VERSION=$( echo "$TAG" | sed 's/^v//' ) | ||
VERSION_PREV=$( echo "$TAG_PREV" | sed 's/^v//' ) | ||
DBVERSION_PREV=$( ls web/updater | grep -E '^[0-9]+\.php$' | sort -n | tail -n1 | cut -d '.' -f1 ) | ||
DBVERSION=$(( $DBVERSION_PREV + 1 )) | ||
|
||
# Bump version in docs, .php, and .sql files | ||
sed -i "s/$VERSION_PREV/$VERSION/" README.md | ||
sed -i "s/^SET @DBVERSION=.*/SET @DBVERSION=\"$DBVERSION\"/" sql/install.sql | ||
sed -i "s/^SET @VERSION=.*/SET @VERSION=\"$VERSION\"/" sql/install.sql | ||
echo "Creating web/updater/$DBVERSION.php" | ||
cat - > web/updater/$DBVERSION.php <<EOF | ||
<?php | ||
if ( !defined('IN_UPDATER') ) | ||
{ | ||
die('Do not access this file directly.'); | ||
} | ||
\$dbversion = $DBVERSION; | ||
\$version = "$VERSION"; | ||
// Perform database schema update notification | ||
print "Updating database and verion schema numbers.<br />"; | ||
\$db->query("UPDATE hlstats_Options SET \`value\` = '\$version' WHERE \`keyname\` = 'version'"); | ||
\$db->query("UPDATE hlstats_Options SET \`value\` = '\$dbversion' WHERE \`keyname\` = 'dbversion'"); | ||
?> | ||
EOF | ||
|
||
echo "Done bumping version to $TAG in all files" |
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
Empty file.
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,14 @@ | ||
<?php | ||
if ( !defined('IN_UPDATER') ) | ||
{ | ||
die('Do not access this file directly.'); | ||
} | ||
|
||
$dbversion = 81; | ||
$version = "1.8.0"; | ||
|
||
// Perform database schema update notification | ||
print "Updating database and verion schema numbers.<br />"; | ||
$db->query("UPDATE hlstats_Options SET `value` = '$version' WHERE `keyname` = 'version'"); | ||
$db->query("UPDATE hlstats_Options SET `value` = '$dbversion' WHERE `keyname` = 'dbversion'"); | ||
?> |