Skip to content

Commit

Permalink
Merge pull request #34 from eug-L/feature/enhance-pattern-matching
Browse files Browse the repository at this point in the history
Feature/enhance pattern matching
  • Loading branch information
eug-L authored Jul 11, 2024
2 parents b586739 + c442a5f commit 081f9dc
Show file tree
Hide file tree
Showing 30 changed files with 1,858 additions and 183 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: create-release-artifact

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2

- name: cached dependencies
uses: actions/cache@v2
id: cached-dependencies
with:
path: |
./vendor
./prestashop1.6/vendor
./prestashop1.7/vendor
# the key will change if composer.lock changes
key: ${{ runner.os }}-dependencies-${{ hashFiles('**/composer.lock') }}

- name: install dependencies
uses: php-actions/composer@v6
with:
command: run build

create-release-artifact:
needs: [build]
name: Creating release artifact
runs-on: ubuntu-latest
strategy:
matrix:
ps_version: ['1.6', '1.7']
steps:
- name: checkout
uses: actions/checkout@v2

- name: cached dependencies
uses: actions/cache@v2
id: cached-dependencies
with:
path: |
./vendor
./prestashop1.6/vendor
./prestashop1.7/vendor
# the key will change if composer.lock changes
key: ${{ runner.os }}-dependencies-${{ hashFiles('**/composer.lock') }}

- name: build artifact
run: composer run auto-index && ./build/build-package.sh

- name: set version for prestashop ${{ matrix.ps_version }}
id: version
run: echo "::set-output name=version::$(awk 'gsub(/<version><!\[CDATA\[|]]><\/version>/,"")' ./prestashop${{ matrix.ps_version }}/config.xml | xargs)"

- name: upload prestashop ${{ matrix.ps_version }} artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/tawk-prestashop-${{ matrix.ps_version }}-${{ steps.version.outputs.version }}.zip
asset_name: tawk-prestashop-${{ matrix.ps_version }}-${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*.zip
./build/tawkto
docker/bin
**/vendor
28 changes: 28 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "tawk/tawk-prestashop",
"description": "Prestashop plugin for tawk.to",
"type": "project",
"repositories": {
"tawk-url-utils": {
"type": "vcs",
"url": "https://github.com/tawk/tawk-url-utils.git"
}
},
"require": {
"tawk/url-utils": "2.0.1"
},
"license": "AFL-3.0",
"scripts": {
"auto-index": "composer run auto-index:1.6 && composer run auto-index:1.7",
"auto-index:1.6": "autoindex prestashop:add:index ./prestashop1.6",
"auto-index:1.7": "autoindex prestashop:add:index ./prestashop1.7",
"build": "composer run build:dev && composer run build:prod",
"build:dev" : "composer install",
"build:prod" : "composer run build:1.6 && composer run build:1.7",
"build:1.6" : "COMPOSER_VENDOR_DIR=./prestashop1.6/vendor composer install --no-dev",
"build:1.7" : "COMPOSER_VENDOR_DIR=./prestashop1.7/vendor composer install --no-dev"
},
"require-dev": {
"prestashop/autoindex": "^2.0"
}
}
Loading

0 comments on commit 081f9dc

Please sign in to comment.