From 54faa20152e72a0a74e94c6bedae0861bc302fc2 Mon Sep 17 00:00:00 2001 From: Joost de Valk Date: Fri, 9 Dec 2022 09:51:53 +0100 Subject: [PATCH] Add WordPress.org deploy action --- .codeclimate.yml | 33 ----------------- .distignore | 17 +++++++++ .gitattributes | 3 +- .github/workflows/deploy.yml | 35 ++++++++++++++++++ .../banner-1544x500.png | Bin .../banner-772x250.png | Bin .../icon-128x128.png | Bin .../icon-256x256.png | Bin {svn-assets => .wordpress-org}/icon.svg | 0 .../screenshot-1.png | Bin .../screenshot-2.png | Bin .../screenshot-3.png | Bin .../screenshot-4.png | Bin .../screenshot-5.png | Bin 14 files changed, 53 insertions(+), 35 deletions(-) delete mode 100644 .codeclimate.yml create mode 100644 .distignore create mode 100644 .github/workflows/deploy.yml rename {svn-assets => .wordpress-org}/banner-1544x500.png (100%) rename {svn-assets => .wordpress-org}/banner-772x250.png (100%) rename {svn-assets => .wordpress-org}/icon-128x128.png (100%) rename {svn-assets => .wordpress-org}/icon-256x256.png (100%) rename {svn-assets => .wordpress-org}/icon.svg (100%) rename {svn-assets => .wordpress-org}/screenshot-1.png (100%) rename {svn-assets => .wordpress-org}/screenshot-2.png (100%) rename {svn-assets => .wordpress-org}/screenshot-3.png (100%) rename {svn-assets => .wordpress-org}/screenshot-4.png (100%) rename {svn-assets => .wordpress-org}/screenshot-5.png (100%) diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 3ec0ff4..0000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -engines: - csslint: - enabled: true - duplication: - enabled: true - config: - languages: - - javascript - - php - exclude_fingerprints: - - bbf999adfc53fc4c2dfe341d3f3b9372 - fixme: - enabled: true - phpmd: - enabled: true - exclude_fingerprints: - - 9e2c003157b8327cc28f5dfdfcf54370 - - e48a303e91de028bf180064acb880dbb - - cd6e7ec8dd32e2bc82ae64126c0e3b03 - - 2c4b9c7656fb60d4a015b73a221fadaf - config: - rulesets: "phpmd.xml" -ratings: - paths: - - "**.css" - - "**.js" - - "**.jsx" - - "**.module" - - "**.php" -exclude_paths: -- grunt/* -- grunt/**/* \ No newline at end of file diff --git a/.distignore b/.distignore new file mode 100644 index 0000000..f3f311f --- /dev/null +++ b/.distignore @@ -0,0 +1,17 @@ +/.wordpress-org +/.git +/.github +/.cache +/node_modules +/tests +/grunt + +.phpcs.xml.dist +.distignore +.gitignore +.removeable-files +Gruntfile.js +package.json +phpmd.xml +phpunit.xml.dist +yarn.lock diff --git a/.gitattributes b/.gitattributes index 1292bd8..e8ba742 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,7 +5,6 @@ # https://www.reddit.com/r/PHP/comments/2jzp6k/i_dont_need_your_tests_in_my_production # https://blog.madewithlove.be/post/gitattributes/ # -.codeclimate.yml export-ignore .eslintignore export-ignore .eslintrc export-ignore .gitattributes export-ignore @@ -21,7 +20,7 @@ yarn.lock export-ignore /.cache export-ignore /.github export-ignore /grunt export-ignore -/svn-assets export-ignore +/.wordpress-org export-ignore /tests export-ignore # diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..7fbcff8 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,35 @@ +name: "Deploy to WordPress.org and create release on GitHub" + +on: + push: + tags: + - "v*" + +jobs: + tag: + name: New tag + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: WordPress Plugin Deploy + uses: 10up/action-wordpress-plugin-deploy@stable + env: + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + SLUG: yoast-comment-hacks # optional, remove if GitHub repo name matches SVN slug, including capitalization + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false diff --git a/svn-assets/banner-1544x500.png b/.wordpress-org/banner-1544x500.png similarity index 100% rename from svn-assets/banner-1544x500.png rename to .wordpress-org/banner-1544x500.png diff --git a/svn-assets/banner-772x250.png b/.wordpress-org/banner-772x250.png similarity index 100% rename from svn-assets/banner-772x250.png rename to .wordpress-org/banner-772x250.png diff --git a/svn-assets/icon-128x128.png b/.wordpress-org/icon-128x128.png similarity index 100% rename from svn-assets/icon-128x128.png rename to .wordpress-org/icon-128x128.png diff --git a/svn-assets/icon-256x256.png b/.wordpress-org/icon-256x256.png similarity index 100% rename from svn-assets/icon-256x256.png rename to .wordpress-org/icon-256x256.png diff --git a/svn-assets/icon.svg b/.wordpress-org/icon.svg similarity index 100% rename from svn-assets/icon.svg rename to .wordpress-org/icon.svg diff --git a/svn-assets/screenshot-1.png b/.wordpress-org/screenshot-1.png similarity index 100% rename from svn-assets/screenshot-1.png rename to .wordpress-org/screenshot-1.png diff --git a/svn-assets/screenshot-2.png b/.wordpress-org/screenshot-2.png similarity index 100% rename from svn-assets/screenshot-2.png rename to .wordpress-org/screenshot-2.png diff --git a/svn-assets/screenshot-3.png b/.wordpress-org/screenshot-3.png similarity index 100% rename from svn-assets/screenshot-3.png rename to .wordpress-org/screenshot-3.png diff --git a/svn-assets/screenshot-4.png b/.wordpress-org/screenshot-4.png similarity index 100% rename from svn-assets/screenshot-4.png rename to .wordpress-org/screenshot-4.png diff --git a/svn-assets/screenshot-5.png b/.wordpress-org/screenshot-5.png similarity index 100% rename from svn-assets/screenshot-5.png rename to .wordpress-org/screenshot-5.png