From 79b1e3732730f8f193932d2b57c04a2db9921661 Mon Sep 17 00:00:00 2001 From: sy-records <52o@qq52o.cn> Date: Tue, 25 Jul 2023 08:23:02 +0800 Subject: [PATCH] Add deploy ci --- .distignore | 4 ++++ .github/workflows/deploy.yml | 44 ++++++++++++++++++++++++++++++++++++ aliyun-oss-wordpress.php | 4 ++-- readme.txt | 9 +++++--- uninstall.php | 11 +++++---- 5 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 .distignore create mode 100644 .github/workflows/deploy.yml diff --git a/.distignore b/.distignore new file mode 100644 index 0000000..44319a2 --- /dev/null +++ b/.distignore @@ -0,0 +1,4 @@ +/.git +/.github +/.distignore +/sdk/composer.lock diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..901e2f5 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,44 @@ +name: Deploy to WordPress.org +on: + pull_request: + release: + types: [ published ] +jobs: + tag: + name: New release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.0' + tools: composer + - name: Build + run: | + composer install -o --no-dev + working-directory: sdk + - name: Set Version + if: github.event_name == 'pull_request' + run: | + echo "VERSION=ci" >> $GITHUB_ENV + - name: WordPress Plugin Deploy + id: deploy + uses: 10up/action-wordpress-plugin-deploy@stable + with: + dry-run: ${{ github.event_name == 'pull_request' }} + generate-zip: ${{ github.event_name == 'release' }} + env: + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + SLUG: oss-aliyun + - name: Upload release asset + uses: actions/upload-release-asset@v1 + if: github.event_name == 'release' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ steps.deploy.outputs.zip-path }} + asset_name: ${{ github.event.repository.name }}.zip + asset_content_type: application/zip diff --git a/aliyun-oss-wordpress.php b/aliyun-oss-wordpress.php index aca63b2..7bef04a 100644 --- a/aliyun-oss-wordpress.php +++ b/aliyun-oss-wordpress.php @@ -3,7 +3,7 @@ Plugin Name: OSS Aliyun Plugin URI: https://github.com/sy-records/aliyun-oss-wordpress Description: 使用阿里云对象存储 OSS 作为附件存储空间。(This is a plugin that uses Aliyun Object Storage Service for attachments remote saving.) -Version: 1.3.2 +Version: 1.4.0 Author: 沈唁 Author URI: https://qq52o.me License: Apache 2.0 @@ -17,7 +17,7 @@ require_once 'sdk/vendor/autoload.php'; use OSS\OssClient; use OSS\Core\OssException; -define('OSS_VERSION', '1.3.2'); +define('OSS_VERSION', '1.4.0'); define('OSS_BASEFOLDER', plugin_basename(dirname(__FILE__))); if (!function_exists('get_home_path')) { diff --git a/readme.txt b/readme.txt index de75ff5..d002453 100644 --- a/readme.txt +++ b/readme.txt @@ -3,9 +3,9 @@ Contributors: shenyanzhi Donate link: https://qq52o.me/sponsor.html Tags: oss, 阿里云, 对象存储, aliyun Requires at least: 4.2 -Tested up to: 6.2 -Requires PHP: 5.6.0 -Stable tag: 1.3.2 +Tested up to: 6.3 +Requires PHP: 7.0.0 +Stable tag: 1.4.0 License: Apache 2.0 License URI: http://www.apache.org/licenses/LICENSE-2.0.html @@ -72,6 +72,9 @@ License URI: http://www.apache.org/licenses/LICENSE-2.0.html == Changelog == += 1.4.0 = +* 支持 WordPress 6.3 版本 + = 1.3.2 = * 添加地域 diff --git a/uninstall.php b/uninstall.php index 76593da..b1bbc57 100644 --- a/uninstall.php +++ b/uninstall.php @@ -1,14 +1,17 @@