From 9605c09e841fc7470774f421e16ce047be39a873 Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Tue, 20 Apr 2021 11:44:55 +0200 Subject: [PATCH 1/6] Don't install dev deps in manual install I added `workflow_dispatch` too, to be able to debug with https://github.blog/2021-04-15-work-with-github-actions-in-your-terminal-with-github-cli/ --- .github/workflows/build-release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index ba72472f..d1a68a7a 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -3,6 +3,8 @@ name: Build Release on: release: types: [ published ] + workflow_dispatch: + jobs: build-manual-install: @@ -15,7 +17,7 @@ jobs: - name: Install dependencies uses: nick-zh/composer@php7.3 with: - args: 'install -oa' + args: 'install -oa --no-dev' - name: Archive assets uses: thedoctor0/zip-release@master From 7a8c07fd3b62137a4e18a8f93cd66d00926416ea Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Tue, 20 Apr 2021 11:57:50 +0200 Subject: [PATCH 2/6] Switch to ramsey installer --- .github/workflows/build-release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index d1a68a7a..a9ff1f6d 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -15,9 +15,10 @@ jobs: uses: actions/checkout@v2 - name: Install dependencies - uses: nick-zh/composer@php7.3 + uses: ramsey/composer-install@v1 with: - args: 'install -oa --no-dev' + composer-options: '-oa --no-dev' + php-version: "7.4" - name: Archive assets uses: thedoctor0/zip-release@master From 3e262c73316f5f288d01af4b28174a9629a90fd5 Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Tue, 20 Apr 2021 12:03:04 +0200 Subject: [PATCH 3/6] Switch version of php --- .github/workflows/build-release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index a9ff1f6d..ef454389 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -13,12 +13,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - + - uses: "shivammathur/setup-php@v2" + with: + php-version: "7.4" - name: Install dependencies uses: ramsey/composer-install@v1 with: composer-options: '-oa --no-dev' - php-version: "7.4" - name: Archive assets uses: thedoctor0/zip-release@master From 4620d51bd2a2fd0d8e0e89fc49643ae7a1350610 Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Tue, 20 Apr 2021 12:06:21 +0200 Subject: [PATCH 4/6] Install pcov --- .github/workflows/build-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index ef454389..c6f8a672 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -20,6 +20,7 @@ jobs: uses: ramsey/composer-install@v1 with: composer-options: '-oa --no-dev' + extensions: pcov - name: Archive assets uses: thedoctor0/zip-release@master From 760208277d3dc2b048e9aeaf7be20d113ba38c89 Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Tue, 20 Apr 2021 12:07:30 +0200 Subject: [PATCH 5/6] Fix pcov location --- .github/workflows/build-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index c6f8a672..aa062d72 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -16,11 +16,11 @@ jobs: - uses: "shivammathur/setup-php@v2" with: php-version: "7.4" + extensions: pcov - name: Install dependencies uses: ramsey/composer-install@v1 with: composer-options: '-oa --no-dev' - extensions: pcov - name: Archive assets uses: thedoctor0/zip-release@master From a6e0ec6a29d978f4d9ca7829d2e87b4f0d3a8e69 Mon Sep 17 00:00:00 2001 From: Lili Date: Wed, 2 Jun 2021 09:53:53 +1000 Subject: [PATCH 6/6] Fix upload-directory command - was using incorrect namespace --- inc/class-wp-cli-command.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/class-wp-cli-command.php b/inc/class-wp-cli-command.php index 95692f4f..81962a68 100644 --- a/inc/class-wp-cli-command.php +++ b/inc/class-wp-cli-command.php @@ -2,6 +2,7 @@ namespace S3_Uploads; +use Aws\Command; use Aws\S3\Transfer; use Exception; use WP_CLI; @@ -206,7 +207,7 @@ public function upload_directory( array $args, array $args_assoc ) { $transfer_args = [ 'concurrency' => $args_assoc['concurrency'], 'debug' => (bool) $args_assoc['verbose'], - 'before' => function ( AWS\Command $command ) { + 'before' => function ( Command $command ) { if ( in_array( $command->getName(), [ 'PutObject', 'CreateMultipartUpload' ], true ) ) { $acl = defined( 'S3_UPLOADS_OBJECT_ACL' ) ? S3_UPLOADS_OBJECT_ACL : 'public-read'; $command['ACL'] = $acl;