From aa3f86bb8638fbd2aff92cecd56a8b83d64cdf4e Mon Sep 17 00:00:00 2001 From: Pranjali Sachan Date: Wed, 7 Jan 2026 21:21:01 -0500 Subject: [PATCH] fixed github actions --- .github/workflows/build-and-release.yml | 19 +++++++------------ README.md | 19 +++++++++---------- build-zip.sh | 11 ++--------- 3 files changed, 18 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 02a53f9..7d0200c 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get Plugin Version id: get_version @@ -22,31 +22,26 @@ jobs: echo "VERSION=$VERSION" >> $GITHUB_ENV echo "::set-output name=version::$VERSION" - - name: Create ZIP + - name: Create Versioned ZIP run: | mkdir -p releases - zip -r releases/accordion-hero-slider.zip accordion-hero-slider -x "*.DS_Store*" "*.git*" + zip -r releases/accordion-hero-slider-v${{ env.VERSION }}.zip accordion-hero-slider -x "*.DS_Store*" "*.git*" - - name: Rename ZIP for PR (Pull Request only) + - name: Prepare ZIP for PR (Pull Request only) if: github.event_name == 'pull_request' run: | - mv releases/accordion-hero-slider.zip releases/accordion-hero-slider-PR-${{ github.event.pull_request.number }}.zip - - - name: Rename ZIP for Release (Push to Tag or Main) - if: github.event_name == 'push' - run: | - cp releases/accordion-hero-slider.zip releases/accordion-hero-slider-v${{ env.VERSION }}.zip + mv releases/accordion-hero-slider-v${{ env.VERSION }}.zip releases/accordion-hero-slider-v${{ env.VERSION }}-PR-${{ github.event.pull_request.number }}.zip - name: Upload Build Artifact (PR Only) if: github.event_name == 'pull_request' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: accordion-hero-slider-PR-${{ github.event.pull_request.number }} path: releases/*.zip - name: Create Release (Tag Only) if: startsWith(github.ref, 'refs/tags/v') - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: releases/accordion-hero-slider-v${{ env.VERSION }}.zip body: "Official release version ${{ env.VERSION }}" diff --git a/README.md b/README.md index 5403d8b..b391b51 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,25 @@ -# Accordion Hero Slider - Project Repository +# Custom Elementor Widgets Repository -This repository contains the source code for the **Accordion Hero Slider** Elementor widget. +This repository is a collection of premium, high-fidelity custom widgets for **Elementor**. Each widget is built as a standalone WordPress plugin for maximum portability and ease of use. ## 📂 Repository Structure -- `accordion-hero-slider/`: The main plugin source code. +- `accordion-hero-slider/`: A premium horizontal accordion hero slider with industry-focused design. - `.github/workflows/`: GitHub Actions for automated builds and releases. - `releases/`: (Automated) Directory where the latest plugin ZIP files are stored. -- `build-zip.sh`: Shell script to manually package the plugin. +- `build-zip.sh`: Shell script to manually package specific widgets. ## 🛠 For Developers -### Building the Plugin -To package the plugin into a ZIP file locally, run: +### Building a Widget +To package a specific widget into a ZIP file locally, run the build script. By default, it targets the `accordion-hero-slider`. ```bash ./build-zip.sh ``` -This will create `releases/accordion-hero-slider.zip`. ### GitHub Actions -- **PR Build**: Every Pull Request automatically generates a versioned ZIP file for testing. -- **Release**: Merging to `main` (or pushing a tag) will automatically create a new GitHub Release with the plugin ZIP attached. +- **PR Build**: Every Pull Request automatically generates versioned ZIP files for the modified widgets. +- **Release**: Merging to `main` (or pushing a version tag like `v*`) will automatically create a new GitHub Release with the corresponding plugin ZIP attached. ## 📝 License -Licensed under GPL v2 or later. +All widgets in this repository are licensed under GPL v2 or later. diff --git a/build-zip.sh b/build-zip.sh index 77a9503..1d34708 100755 --- a/build-zip.sh +++ b/build-zip.sh @@ -10,16 +10,9 @@ VERSIONED_ZIP_NAME="accordion-hero-slider-v$VERSION.zip" # Create output directory if it doesn't exist mkdir -p $OUTPUT_DIR -# Remove old zips -rm -f $OUTPUT_DIR/*.zip - -# Create the zip file +# Create the versioned zip file # Exclude git files and any other unnecessary local files -zip -r $OUTPUT_DIR/$ZIP_NAME $PLUGIN_DIR -x "*.DS_Store*" "*.git*" "*/README.md" - -# Create a versioned copy -cp $OUTPUT_DIR/$ZIP_NAME $OUTPUT_DIR/$VERSIONED_ZIP_NAME +zip -r $OUTPUT_DIR/$VERSIONED_ZIP_NAME $PLUGIN_DIR -x "*.DS_Store*" "*.git*" echo "✅ Build Complete!" -echo "📍 Main ZIP: $OUTPUT_DIR/$ZIP_NAME" echo "📍 Versioned ZIP: $OUTPUT_DIR/$VERSIONED_ZIP_NAME"