-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from tawk/release/pattern-matching
Release/pattern matching
- Loading branch information
Showing
14 changed files
with
566 additions
and
79 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-oc3-${{ steps.version.outputs.version }}.zip | ||
asset_name: tawk-oc3-${{ 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-oc3-${{ steps.version.outputs.version }}.ocmod.zip | ||
asset_name: tawk-oc3-${{ 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-oc3-$release_version.ocmod.zip upload README.md | ||
zip -9 -rq tawk-oc3-$release_version.zip admin catalog README.md | ||
|
||
echo "Cleaning up" | ||
rm -rf ./upload | ||
$(cd ./tmp && zip -9 -rq tawk-oc3-$release_version.ocmod.zip upload README.md); | ||
$(cd ./tmp && zip -9 -rq tawk-oc3-$release_version.zip admin catalog README.md); | ||
|
||
echo "Done!" |
Oops, something went wrong.