Initial commit

This commit is contained in:
2026-04-10 19:09:13 +02:00
commit 0cb8ca0f46
3 changed files with 152 additions and 0 deletions
+68
View File
@@ -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 }}