Commit 9f2574e6 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

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
parent 6b36a801
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
      "@semantic-release/git",
      {
        "assets": [
          "app/Config/Constants.php",
          "composer.json",
          "package.json",
          "package-lock.json",
+9 −0
Original line number Diff line number Diff line
<?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
//--------------------------------------------------------------------
+4 −3
Original line number Diff line number Diff line
@@ -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"
+3 −0
Original line number Diff line number Diff line
@@ -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/