diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2ebf2c1707cb..59e4080640f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,15 @@ jobs: git checkout main npm i npm run build - cp -r dist/react/* ../public/react + + for file in dist/react/* ; do + filename=$(basename -- "$file") + extension="${filename##*.}" + filename="${filename%.*}" + version=${{ github.event.release.tag_name }} + cp dist/react/$file ../public/react/$filename"."$version"."$extension + done + mkdir -p ../public/tinymce_6.4.2/tinymce/js/ cp -r node_modules/tinymce ../public/tinymce_6.4.2/tinymce/js/ cd .. diff --git a/app/Console/Commands/ReactBuilder.php b/app/Console/Commands/ReactBuilder.php index 4bec0cefb5c5..c30e0c4bbcd5 100644 --- a/app/Console/Commands/ReactBuilder.php +++ b/app/Console/Commands/ReactBuilder.php @@ -12,7 +12,6 @@ namespace App\Console\Commands; use Illuminate\Console\Command; -use Illuminate\Support\Facades\Storage; class ReactBuilder extends Command { @@ -48,13 +47,11 @@ class ReactBuilder extends Command public function handle() { $includes = ''; - - Storage::makeDirectory(public_path('react')); $directoryIterator = new \RecursiveDirectoryIterator(public_path('react'), \RecursiveDirectoryIterator::SKIP_DOTS); foreach (new \RecursiveIteratorIterator($directoryIterator) as $file) { - if ($file->getExtension() == 'js') { + if ($file->getExtension() == 'js' && stripos($file->getFileName(), config('ninja.app_version')) !== false) { if (str_contains($file->getFileName(), 'index-')) { $includes .= ''."\n"; } else { @@ -62,7 +59,7 @@ class ReactBuilder extends Command } } - if (str_contains($file->getFileName(), '.css')) { + if (str_contains($file->getFileName(), '.css' && stripos($file->getFileName(), config('ninja.app_version')) !== false)) { $includes .= ''."\n"; } }