feat: display castopod version in admin footer

add CP_VERSION constant in app/Config/Constants.php that updates upon release through
prepare-release.sh script

closes #68
This commit is contained in:
Yassine Doghri 2020-10-26 11:48:17 +00:00
parent 6b36a80102
commit 9f2574e6fb
4 changed files with 17 additions and 3 deletions

View File

@ -19,6 +19,7 @@
"@semantic-release/git",
{
"assets": [
"app/Config/Constants.php",
"composer.json",
"package.json",
"package-lock.json",

View File

@ -1,5 +1,14 @@
<?php
//--------------------------------------------------------------------------
// Castopod Version
//--------------------------------------------------------------------------
// The Castopod version number to display.
//
// NOTE: this constant is updated upon release with Continuous Integration.
//
defined('CP_VERSION') || define('CP_VERSION', '1.0.0-alpha.8');
//--------------------------------------------------------------------
// App Namespace
//--------------------------------------------------------------------

View File

@ -41,10 +41,11 @@
</div>
</main>
<footer class="px-2 py-2 mx-auto text-xs text-right holy-grail-footer">
<small><?= lang('Common.powered_by', [
<?= lang('Common.powered_by', [
'castopod' =>
'<a class="underline hover:no-underline" href="https://castopod.org/" target="_blank" rel="noreferrer noopener">Castopod</a>',
]) ?></small>
'<a class="underline hover:no-underline" href="https://castopod.org/" target="_blank" rel="noreferrer noopener">Castopod</a> v' .
CP_VERSION,
]) ?>
</footer>
<button
type="button"

View File

@ -6,6 +6,9 @@ COMPOSER_VERSION=$(echo "$VERSION" | perl -pe 's/(?<=[alpha|beta])\.//g')
# replace composer.json version using jq
echo "$( jq '.version = "'$COMPOSER_VERSION'"' composer.json )" > composer.json
# replace CP_VERSION constant in app/config/constants
sed -i "s/^defined('CP_VERSION').*/defined('CP_VERSION') || define('CP_VERSION', '$VERSION');/" ./app/Config/Constants.php
# download GeoLite2-City archive and extract it to writable/uploads
wget -c "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=v3PguJMcmZMb9Ld0&suffix=tar.gz" -O - | tar -xz -C ./writable/uploads/