-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add tawk-url-utils lib and used it to match the exclude/include urls * Add an upgrade manager and handled backwards compatibility for pattern matching * Fix version comparison to handle backwards compatibility * Updated package structure and added function to check valid hostname instead of directly comparing to the base url * Update readme for changelog and new package structure and added example patterns tooltip * Added release workflow * Updated build script to include new files on non-ocmod package * Fix asset path for uploading artifacts --------- Co-authored-by: Alvin Johnson So <[email protected]> Co-authored-by: asyraf <[email protected]>
- Loading branch information
1 parent
72af31c
commit 634eca2
Showing
14 changed files
with
569 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: create-release-artifact | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
create-release-artifact: | ||
name: Creating release artifact | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: cached dependencies | ||
uses: actions/cache@v2 | ||
id: cached-dependencies | ||
with: | ||
path: ./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:prod | ||
|
||
- name: version | ||
id: version | ||
run: echo "::set-output name=version::$(jq -r '.version' ./composer.json)" | ||
|
||
- name: build artifacts | ||
run: composer run package | ||
|
||
- name: upload regular artifact | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./tmp/tawk-oc2-${{ steps.version.outputs.version }}.zip | ||
asset_name: tawk-oc2-${{ steps.version.outputs.version }}.zip | ||
asset_content_type: application/zip | ||
|
||
- name: upload ocmod artifact | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./tmp/tawk-oc2-${{ steps.version.outputs.version }}.ocmod.zip | ||
asset_name: tawk-oc2-${{ steps.version.outputs.version }}.ocmod.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
upload/ | ||
*.zip | ||
docker/bin | ||
/vendor | ||
/docker/bin | ||
/tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
#!/bin/sh | ||
|
||
if [ -z "$1" ] | ||
then | ||
echo "Release version wasn't specified"; | ||
return; | ||
fi | ||
release_version=$(jq -r '.version' ./composer.json); | ||
|
||
release_version=$1; | ||
echo "Creating temporary directory" | ||
rm -rf ./tmp; | ||
mkdir -p ./tmp/upload; | ||
mkdir -p ./tmp/admin/controller/extension/module/tawkto; | ||
mkdir -p ./tmp/catalog/controller/extension/module/tawkto; | ||
|
||
echo "Creating temporary upload directory" | ||
rm -rf ./upload | ||
mkdir ./upload | ||
|
||
echo "Copying files to upload directory" | ||
cp -r admin ./upload/ | ||
cp -r catalog ./upload/ | ||
echo "Copying files" | ||
cp README.md ./tmp; | ||
cp -r admin ./tmp; | ||
cp -r catalog ./tmp; | ||
cp -r upgrades ./tmp/admin/controller/extension/module/tawkto; | ||
cp -r vendor ./tmp/admin/controller/extension/module/tawkto; | ||
cp -r vendor ./tmp/catalog/controller/extension/module/tawkto; | ||
cp -r ./tmp/admin ./tmp/upload; | ||
cp -r ./tmp/catalog ./tmp/upload; | ||
|
||
echo "Creating opencart 3 zip files" | ||
zip -9 -rq tawk-oc2-$release_version.ocmod.zip upload README.md | ||
zip -9 -rq tawk-oc2-$release_version.zip admin catalog README.md | ||
|
||
echo "Cleaning up" | ||
rm -rf ./upload | ||
echo "Creating opencart 2 zip files" | ||
$(cd ./tmp && zip -9 -rq tawk-oc2-$release_version.ocmod.zip upload README.md); | ||
$(cd ./tmp && zip -9 -rq tawk-oc2-$release_version.zip admin catalog README.md); | ||
|
||
echo "Done!" |
Oops, something went wrong.