forked from concretecms/concretecms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into fix/11660
- Loading branch information
Showing
104 changed files
with
2,513 additions
and
937 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Build assets | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
build-assets: | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
nodejs-version: 18 | ||
# Just one case may have this set to yes | ||
update-repo: yes | ||
name: Build assets (node ${{ matrix.nodejs-version }} on ${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Setup NodeJS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.nodejs-version }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install NodeJS dependencies | ||
run: | | ||
cd "${{ github.workspace }}/build" | ||
npm ci | ||
- name: Build assets (dev) | ||
run: | | ||
cd "${{ github.workspace }}/build" | ||
npm run-script dev | ||
- name: Tell git to ignore the built files | ||
run: | | ||
cd "${{ github.workspace }}/build" | ||
npm run-script git-skip | ||
- name: Check that git thinks the repo is clean | ||
run: | | ||
cd "${{ github.workspace }}" | ||
git diff --exit-code --name-status | ||
- name: Revert changed files | ||
run: | | ||
cd "${{ github.workspace }}/build" | ||
npm run-script git-revert | ||
- name: Check that git thinks the repo is clean | ||
run: | | ||
cd "${{ github.workspace }}" | ||
git diff --exit-code --name-status | ||
- name: Build assets (prod) | ||
run: | | ||
cd "${{ github.workspace }}/build" | ||
npm run-script prod | ||
- name: Update repository | ||
if: matrix.update-repo == 'yes' | ||
run: | | ||
cd '${{ github.workspace }}' | ||
if git diff --exit-code --name-status; then | ||
echo "Repository not updated because no change has been detected" | ||
elif [ '${{ github.event_name }}' != 'push' ]; then | ||
echo "Repository not updated because it's a '${{ github.event_name }}' operation and not a 'push' one" | ||
elif [ '${{ github.repository }}' != 'concretecms/concretecms' ]; then | ||
echo "Repository not updated because it's '${{ github.repository }}' and not 'concretecms/concretecms'" | ||
else | ||
echo 'Changes detected!' | ||
git config --local user.name 'GitHub Action' | ||
git config --local user.email '[email protected]' | ||
git add -A | ||
git commit -m 'Update built assets' | ||
git push | ||
fi |
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 |
---|---|---|
@@ -1,18 +1,14 @@ | ||
<?php | ||
|
||
defined('C5_EXECUTE') or die('Access Denied.'); | ||
declare(strict_types=1); | ||
|
||
/* | ||
* ---------------------------------------------------------------------------- | ||
* Load all composer autoload items. | ||
* ---------------------------------------------------------------------------- | ||
*/ | ||
defined('C5_EXECUTE') or die('Access Denied.'); | ||
|
||
// If the checker class is already provided, likely we have been included in a separate composer project | ||
if (!class_exists(\DoctrineXml\Checker::class)) { | ||
// Otherwise, lets try to load composer ourselves | ||
if (!@include(DIR_BASE_CORE . '/' . DIRNAME_VENDOR . '/autoload.php')) { | ||
// If the follwing class is already provided, we are likely in a composer-based Concrete installation | ||
if (!class_exists(Illuminate\Container\Container::class)) { | ||
// Otherwise, let's try to load composer ourselves | ||
if (!@include DIR_BASE_CORE . '/' . DIRNAME_VENDOR . '/autoload.php') { | ||
echo 'Third party libraries not installed. Make sure that composer has required libraries in the concrete/ directory.'; | ||
die(1); | ||
exit(1); | ||
} | ||
} |
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
Oops, something went wrong.