From fe1c7fda787abe64088aabddb6fcd6e9abdb2f42 Mon Sep 17 00:00:00 2001 From: Mark Kelnar <749603+markkelnar@users.noreply.github.com> Date: Wed, 30 Aug 2023 11:41:13 -0500 Subject: [PATCH 1/4] Use .distignore when build articat for github release --- .distignore | 50 ++++++++++++------------- .github/workflows/upload-plugin-zip.yml | 13 ++++--- composer.json | 17 --------- 3 files changed, 31 insertions(+), 49 deletions(-) diff --git a/.distignore b/.distignore index 2741424e..1acdb8fa 100644 --- a/.distignore +++ b/.distignore @@ -3,62 +3,58 @@ .deployignore .distignore .editorconfig +.env +.env.dist +.env.testing .eslintignore .eslintrc .git +.gitattributes .gitignore .github .gitlab-ci.yml .idea +.log .travis.yml .DS_Store .vscode .wordpress-org -Thumbs.db behat.yml bitbucket-pipelines.yml bin .circleci/config.yml +codeception.dist.yml +codeception.yml composer.json composer.lock +c3.php +CHANGELOG.md dependencies.yml +docker-compose.yml +/docker +/docker-output +/docs Gruntfile.js -package.json -package-lock.json -phpunit.xml -phpunit.xml.dist multisite.xml multisite.xml.dist +node_modules +package.json +package-lock.json .phpcs.xml phpcs.xml .phpcs.xml.dist phpcs.xml.dist +phpstan.neon.dist +/phpstan +phpunit.xml +phpunit.xml.dist +/plugin-build README.md +tests +Thumbs.db webpack.config.js wp-cli.local.yml yarn.lock -tests -node_modules *.sql *.tar.gz *.zip -/docs -/plugin-build -/.log -.env -.env.dist -phpcs.xml -phpstan.neon.dist -phpunit.xml.dist -README.md -docker-compose.yml -codeception.dist.yml -codeception.yml -composer.json -composer.lock -c3.php -CHANGELOG.md -.gitattributes -.gitignore -/docker -/docker-output diff --git a/.github/workflows/upload-plugin-zip.yml b/.github/workflows/upload-plugin-zip.yml index 9d2bdc21..395fe208 100644 --- a/.github/workflows/upload-plugin-zip.yml +++ b/.github/workflows/upload-plugin-zip.yml @@ -17,15 +17,18 @@ jobs: run: | composer install --no-dev --optimize-autoloader - name: Create Artifact + # Create a zip file similar to 10up/action-wordpress-plugin-deploy action run: | - mkdir plugin-build - composer archive -vvv --format=zip --file="plugin-build/wp-graphql-smart-cache" + mkdir wpgraphql-smart-cache + rsync -rc --exclude-from=.distignore . wpgraphql-smart-cache/ --delete --delete-excluded + zip -r wpgraphql-smart-cache.zip wpgraphql-smart-cache + rm -rf wpgraphql-smart-cache - name: Upload artifact uses: actions/upload-artifact@v2 with: - name: wp-graphql-smart-cache - path: plugin-build/wp-graphql-smart-cache.zip + name: wpgraphql-smart-cache + path: wpgraphql-smart-cache.zip - name: Upload release asset uses: softprops/action-gh-release@v1 with: - files: plugin-build/wp-graphql-smart-cache.zip + files: wpgraphql-smart-cache.zip diff --git a/composer.json b/composer.json index 61919ed9..c9946344 100644 --- a/composer.json +++ b/composer.json @@ -56,23 +56,6 @@ "phpstan analyze --ansi --memory-limit=1G" ] }, - "archive": { - "exclude": [ - "*.yml", - "*.zip", - ".env*", - "!.wordpress-org/", - "!build", - "docker/", - "docs/", - "node_modules/", - "packages", - "plugin-build/", - "tests/", - "!vendor/", - "wp-content/" - ] - }, "config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true, From 384170976138e75a9a54de6181e89224b84e76db Mon Sep 17 00:00:00 2001 From: Mark Kelnar <749603+markkelnar@users.noreply.github.com> Date: Wed, 30 Aug 2023 11:57:24 -0500 Subject: [PATCH 2/4] ignore the new directory from the zip --- .github/workflows/upload-plugin-zip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-plugin-zip.yml b/.github/workflows/upload-plugin-zip.yml index 395fe208..56d6ae5c 100644 --- a/.github/workflows/upload-plugin-zip.yml +++ b/.github/workflows/upload-plugin-zip.yml @@ -20,7 +20,7 @@ jobs: # Create a zip file similar to 10up/action-wordpress-plugin-deploy action run: | mkdir wpgraphql-smart-cache - rsync -rc --exclude-from=.distignore . wpgraphql-smart-cache/ --delete --delete-excluded + rsync -rc --exclude-from=.distignore --exclude=wpgraphql-smart-cache . wpgraphql-smart-cache/ --delete --delete-excluded -v zip -r wpgraphql-smart-cache.zip wpgraphql-smart-cache rm -rf wpgraphql-smart-cache - name: Upload artifact From 9b8bd7d4644f0154793e0afb16fc8ebff5134aa9 Mon Sep 17 00:00:00 2001 From: Mark Kelnar <749603+markkelnar@users.noreply.github.com> Date: Wed, 30 Aug 2023 12:41:34 -0500 Subject: [PATCH 3/4] Move zip command to composer scripts --- .github/workflows/upload-plugin-zip.yml | 5 +---- composer.json | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/upload-plugin-zip.yml b/.github/workflows/upload-plugin-zip.yml index 56d6ae5c..cb7c4284 100644 --- a/.github/workflows/upload-plugin-zip.yml +++ b/.github/workflows/upload-plugin-zip.yml @@ -19,10 +19,7 @@ jobs: - name: Create Artifact # Create a zip file similar to 10up/action-wordpress-plugin-deploy action run: | - mkdir wpgraphql-smart-cache - rsync -rc --exclude-from=.distignore --exclude=wpgraphql-smart-cache . wpgraphql-smart-cache/ --delete --delete-excluded -v - zip -r wpgraphql-smart-cache.zip wpgraphql-smart-cache - rm -rf wpgraphql-smart-cache + composer run-script zip - name: Upload artifact uses: actions/upload-artifact@v2 with: diff --git a/composer.json b/composer.json index c9946344..14291579 100644 --- a/composer.json +++ b/composer.json @@ -54,6 +54,12 @@ ], "phpstan": [ "phpstan analyze --ansi --memory-limit=1G" + ], + "zip": [ + "mkdir -p plugin-build/wpgraphql-smart-cache", + "rsync -rc --exclude-from=.distignore --exclude=plugin-build . plugin-build/wpgraphql-smart-cache/ --delete --delete-excluded -v", + "cd plugin-build ; zip -r wpgraphql-smart-cache.zip wpgraphql-smart-cache", + "rm -rf plugin-build/wpgraphql-smart-cache/" ] }, "config": { From ea43cd52934ad1235b30074790b12437bfad5ee1 Mon Sep 17 00:00:00 2001 From: Mark Kelnar <749603+markkelnar@users.noreply.github.com> Date: Thu, 31 Aug 2023 00:58:25 -0500 Subject: [PATCH 4/4] Add plugin build path to zip file --- .github/workflows/upload-plugin-zip.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upload-plugin-zip.yml b/.github/workflows/upload-plugin-zip.yml index cb7c4284..b1c50356 100644 --- a/.github/workflows/upload-plugin-zip.yml +++ b/.github/workflows/upload-plugin-zip.yml @@ -24,8 +24,8 @@ jobs: uses: actions/upload-artifact@v2 with: name: wpgraphql-smart-cache - path: wpgraphql-smart-cache.zip + path: plugin-build/wpgraphql-smart-cache.zip - name: Upload release asset uses: softprops/action-gh-release@v1 with: - files: wpgraphql-smart-cache.zip + files: plugin-build/wpgraphql-smart-cache.zip