From 99e2f56e0fa5ae6b5e83fb43587e08ba03fe9326 Mon Sep 17 00:00:00 2001 From: Zura Sekhniashvili Date: Wed, 12 Nov 2025 02:14:30 +0400 Subject: [PATCH] Release version 0.4.0 with full Laravel environment setup in GitHub Actions, improved artifact management, and fixes for build failures related to Laravel Vite plugins. Updated CHANGELOG, README, and composer.json to reflect new version and enhancements. --- CHANGELOG.md | 17 +++++++++++++++ README.md | 2 +- composer.json | 2 +- stubs/hostinger-deploy.yml | 43 ++++++++++++++++++++++++++++++++++++-- 4 files changed, 60 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ca8afd..dfa6516 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.4.0] - 2025-11-11 + +### Added +- Full Laravel environment setup in `build-assets` job to support Laravel Vite plugins +- PHP, Composer, and .env configuration in the build-assets job +- Artifact upload/download mechanism to share built assets between GitHub Actions jobs +- `build-assets` job now properly generates `vendor/autoload.php` before building frontend assets + +### Fixed +- Fixed build failure when Laravel Vite plugins require PHP artisan commands during asset compilation +- Fixed missing Composer dependencies causing "vendor/autoload.php not found" error during npm build +- Fixed artifact sharing issue where built assets from `build-assets` job were not available in `deploy` job + +### Improved +- GitHub Actions workflow now properly isolates and shares build artifacts between jobs +- Better dependency management between jobs (deploy now depends on both tests and build-assets) + ## [0.3.0] - 2025-01-XX ### Added diff --git a/README.md b/README.md index b7854a4..c065206 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Deploy your Laravel application to Hostinger shared hosting with automated GitHu Install the package via Composer: ```bash -composer require thecodeholic/laravel-hostinger-deploy:^0.3 --dev +composer require thecodeholic/laravel-hostinger-deploy:^0.4 --dev ``` Or install the latest version: diff --git a/composer.json b/composer.json index a1004d8..b738deb 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "thecodeholic/laravel-hostinger-deploy", "description": "Laravel package for automated Hostinger deployment with GitHub Actions support", "type": "library", - "version": "0.3.0", + "version": "0.4.0", "license": "MIT", "keywords": [ "laravel", diff --git a/stubs/hostinger-deploy.yml b/stubs/hostinger-deploy.yml index 224109e..b685bcd 100644 --- a/stubs/hostinger-deploy.yml +++ b/stubs/hostinger-deploy.yml @@ -65,6 +65,29 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '{{PHP_VERSION}}' + extensions: mbstring, xml, bcmath, pdo_mysql, pdo_sqlite, gd, zip + coverage: none + + - name: Copy .env + run: | + if [ -f .env.example ]; then + cp .env.example .env + else + echo "⚠️ .env.example not found, creating minimal .env" + echo "APP_ENV=testing" > .env + echo "APP_KEY=" >> .env + fi + + - name: Install Composer Dependencies + run: composer install --prefer-dist --no-interaction --no-progress + + - name: Generate Application Key + run: php artisan key:generate --ansi + - name: Check for package.json id: check_package run: | @@ -102,10 +125,19 @@ jobs: echo "⚠️ No build script found in package.json" fi + - name: Upload Built Assets + if: steps.check_package.outputs.exists == 'true' + uses: actions/upload-artifact@v4 + with: + name: build-assets + path: public/build/ + if-no-files-found: ignore + retention-days: 1 + deploy: name: Deploy to Hostinger runs-on: ubuntu-latest - needs: [tests] + needs: [tests, build-assets] if: success() || failure() # Deploy even if tests fail (you can change to 'success()' to require passing tests) steps: @@ -118,6 +150,13 @@ jobs: php-version: '{{PHP_VERSION}}' extensions: mbstring, xml, bcmath, pdo_mysql + - name: Download Built Assets + uses: actions/download-artifact@v4 + with: + name: build-assets + path: public/build/ + continue-on-error: true + - name: Setup Node.js (for asset building) if: hashFiles('package.json') != '' uses: actions/setup-node@v4 @@ -179,7 +218,7 @@ jobs: # Ensure we're on the correct branch git fetch origin git checkout {{BRANCH}} - git pull origin {{BRANCH}} + git reset --hard origin/{{BRANCH}} echo "📦 Installing Composer dependencies..." composer install --no-dev --optimize-autoloader --no-interaction --prefer-dist