Initial commit
This commit is contained in:
@@ -0,0 +1,68 @@
|
|||||||
|
name: Build OpenCart Extension
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install XML tools
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y libxml2-utils zip
|
||||||
|
|
||||||
|
- name: Extract metadata from install.xml
|
||||||
|
id: meta
|
||||||
|
run: |
|
||||||
|
CODE=$(xmllint --xpath "string(//code)" install.xml)
|
||||||
|
VERSION=v$(xmllint --xpath "string(//version)" install.xml)
|
||||||
|
|
||||||
|
echo "CODE=$CODE" >> $GITHUB_ENV
|
||||||
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
echo "FILENAME=${CODE}_${VERSION}.ocmod.zip" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
echo "Extension code: $CODE"
|
||||||
|
echo "Version: $VERSION"
|
||||||
|
|
||||||
|
- name: Prepare package
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cp -r upload build/ 2>/dev/null || true
|
||||||
|
cp install.xml build/ 2>/dev/null || true
|
||||||
|
cp install.php build/ 2>/dev/null || true
|
||||||
|
cp install.sql build/ 2>/dev/null || true
|
||||||
|
|
||||||
|
- name: Build ocmod package
|
||||||
|
run: |
|
||||||
|
cd build
|
||||||
|
zip -r ../${FILENAME} .
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
- name: Install tea CLI
|
||||||
|
run: |
|
||||||
|
curl -L https://dl.gitea.io/tea/main/tea-main-linux-amd64 -o tea
|
||||||
|
chmod +x tea
|
||||||
|
sudo mv tea /usr/local/bin/
|
||||||
|
|
||||||
|
- name: Configure tea
|
||||||
|
run: |
|
||||||
|
tea login add \
|
||||||
|
--name gitea \
|
||||||
|
--url ${{ vars.SERVER_URL }} \
|
||||||
|
--token ${{ secrets.OC3_EXTENSION_RELEASE_TOKEN }}
|
||||||
|
|
||||||
|
- name: Create release
|
||||||
|
run: |
|
||||||
|
TAG="${VERSION}"
|
||||||
|
|
||||||
|
tea release create "$TAG" \
|
||||||
|
--title "${CODE} ${VERSION}" \
|
||||||
|
--asset "${FILENAME}" \
|
||||||
|
--repo ${{ gitea.repository }}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
# OpenCart 3 Module Template
|
||||||
|
|
||||||
|
A comprehensive template for developing custom modules and extensions for OpenCart 3.x e-commerce platform.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
### 🚀 OpenCart 3 Compatibility
|
||||||
|
- Fully compatible with OpenCart 3.x versions
|
||||||
|
- Uses OCMOD (OpenCart Modification) system for safe modifications
|
||||||
|
- No core file changes required
|
||||||
|
|
||||||
|
### 📦 Module Structure
|
||||||
|
- **install.xml**: OCMOD installation file with modification definitions
|
||||||
|
- **upload/**: Directory for module files to be uploaded to OpenCart
|
||||||
|
- **install.php**: Optional PHP installation script
|
||||||
|
- **install.sql**: Optional database installation script
|
||||||
|
|
||||||
|
### 🔄 Automated Releases
|
||||||
|
- Integrated Gitea Actions workflow for automatic builds
|
||||||
|
- Generates `.ocmod.zip` packages on push to main branch
|
||||||
|
- Extracts metadata from `install.xml` for versioning
|
||||||
|
- Ready-to-install extension packages
|
||||||
|
|
||||||
|
### 🛠️ Development Tools
|
||||||
|
- XML-based modification system
|
||||||
|
- Template structure for rapid module development
|
||||||
|
- CI/CD pipeline for quality assurance
|
||||||
|
- Version management through install.xml
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. Clone this repository
|
||||||
|
2. Customize the `install.xml` with your module details:
|
||||||
|
- Set `<name>`, `<code>`, and `<version>`
|
||||||
|
- Add your modifications in the `<file>` sections
|
||||||
|
3. Place your module files in the `upload/` directory
|
||||||
|
4. Add installation scripts if needed (`install.php`, `install.sql`)
|
||||||
|
5. Push to your repository to trigger automatic release build
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### For Module Developers
|
||||||
|
1. Use this template as a starting point for new OpenCart modules
|
||||||
|
2. Define your modifications in `install.xml`
|
||||||
|
3. Add custom files to `upload/` directory
|
||||||
|
4. Test locally before deploying
|
||||||
|
|
||||||
|
### For Store Owners
|
||||||
|
1. Download the generated `.ocmod.zip` from releases
|
||||||
|
2. Upload via OpenCart's Extension Installer
|
||||||
|
3. Install and configure the module through admin panel
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- OpenCart 3.x
|
||||||
|
- PHP 7.3 or higher
|
||||||
|
- MySQL 5.7 or higher
|
||||||
|
- OCMOD support enabled
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
**Mohamed Youssef**
|
||||||
|
Website: [my-dev.pro](https://my-dev.pro)
|
||||||
|
Email: Contact through website
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This template is provided as-is for OpenCart module development. Please check individual module licenses for usage terms.
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<modification>
|
||||||
|
<name></name>
|
||||||
|
<code></code>
|
||||||
|
<author><![CDATA[<b style="color: green">MY-Dev | </b><b>Mohamed Youssef</b>]]></author>
|
||||||
|
<link>https://my-dev.pro</link>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
|
||||||
|
<file path="">
|
||||||
|
<operation error="skip">
|
||||||
|
<search><![CDATA[]]></search>
|
||||||
|
<add position=""><![CDATA[]]></add>
|
||||||
|
</operation>
|
||||||
|
</file>
|
||||||
|
|
||||||
|
</modification>
|
||||||
Reference in New Issue
Block a user