mirror of
https://github.com/e107inc/e107.git
synced 2025-08-07 15:16:30 +02:00
Build Release: Include core image by itself in release files
Also fixed an E_NOTICE pertaining to array_shift()
This commit is contained in:
3
.github/workflows/build-release/OsHelper.php
vendored
3
.github/workflows/build-release/OsHelper.php
vendored
@@ -52,7 +52,8 @@ class OsHelper
|
|||||||
|
|
||||||
public static function gitVersionToPhpVersion($gitVersion, $verFileVersion = "0")
|
public static function gitVersionToPhpVersion($gitVersion, $verFileVersion = "0")
|
||||||
{
|
{
|
||||||
$verFileVersion = array_shift(explode(" ", $verFileVersion));
|
$verFileVersion = explode(" ", $verFileVersion);
|
||||||
|
$verFileVersion = array_shift($verFileVersion);
|
||||||
$version = preg_replace("/^v/", "", $gitVersion);
|
$version = preg_replace("/^v/", "", $gitVersion);
|
||||||
$versionSplit = explode("-", $version);
|
$versionSplit = explode("-", $version);
|
||||||
if (count($versionSplit) > 1)
|
if (count($versionSplit) > 1)
|
||||||
|
21
.github/workflows/build-release/e107_make.php
vendored
21
.github/workflows/build-release/e107_make.php
vendored
@@ -252,7 +252,7 @@ class e107Build
|
|||||||
$this->createCoreImage(); // Create Image
|
$this->createCoreImage(); // Create Image
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->copyCoreImage();
|
$this->copyCoreImage($this->exportDir . "e107_admin/core_image.php");
|
||||||
|
|
||||||
if (isset($rel['readme']))
|
if (isset($rel['readme']))
|
||||||
{
|
{
|
||||||
@@ -276,6 +276,8 @@ class e107Build
|
|||||||
|
|
||||||
$releaseDir = "{$this->config['baseDir']}/target/{$this->config['main']['name']}/release/" . $this->releaseDir;
|
$releaseDir = "{$this->config['baseDir']}/target/{$this->config['main']['name']}/release/" . $this->releaseDir;
|
||||||
|
|
||||||
|
$this->copyCoreImage($releaseDir . "/core_image.php");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* git archive -o update.zip HEAD $(git diff --name-only [id])
|
* git archive -o update.zip HEAD $(git diff --name-only [id])
|
||||||
*
|
*
|
||||||
@@ -490,22 +492,21 @@ class e107Build
|
|||||||
$this->changeDir($dir);
|
$this->changeDir($dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function copyCoreImage()
|
private function copyCoreImage($destination)
|
||||||
{
|
{
|
||||||
$orig = $this->tempDir . "core_image.php";
|
$source = $this->tempDir . "core_image.php";
|
||||||
$dest = $this->exportDir . "e107_admin/core_image.php";
|
|
||||||
|
|
||||||
if (!file_exists($orig))
|
if (!file_exists($source))
|
||||||
{
|
{
|
||||||
throw new RuntimeException("Core image file not found: {$orig}");
|
throw new RuntimeException("Core image file not found: {$source}");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->status("Copying Core Image into export directory", true);
|
$this->status("Copying Core Image into: $destination", true);
|
||||||
OsHelper::runValidated("cp -rf " . escapeshellarg($orig) . " " . escapeshellarg($dest));
|
OsHelper::runValidated("cp -rf " . escapeshellarg($source) . " " . escapeshellarg($destination));
|
||||||
|
|
||||||
if (!file_exists($dest))
|
if (!file_exists($destination))
|
||||||
{
|
{
|
||||||
throw new RuntimeException("Core image file didnt copy to: {$dest}");
|
throw new RuntimeException("Core image file didnt copy to: {$destination}");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user