Skip to content

Commit

Permalink
Add github workflow to deploy to WP Plugin repo (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacedmonkey authored Dec 1, 2023
1 parent a30e72e commit 1208bf3
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 68 deletions.
39 changes: 39 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# A set of files you probably don't want in your WordPress.org distribution
.distignore
.editorconfig
.git
.gitignore
.gitlab-ci.yml
.travis.yml
.DS_Store
.wordpress-org
composer.json
composer.lock
book.json
Thumbs.db
behat.yml
bitbucket-pipelines.yml
bin
.circleci/config.yml
docs
.github
Gruntfile.js
package.json
package-lock.json
phpunit.xml
phpunit.xml.dist
phpunit-multisite.xml.dist
multisite.xml
multisite.xml.dist
.phpcs.xml
phpcs.xml
.phpcs.xml.dist
phpcs.xml.dist
README.md
wp-cli.local.yml
yarn.lock
tests
node_modules
*.sql
*.tar.gz
*.zip
43 changes: 43 additions & 0 deletions .github/workflows/deploytowp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy to WordPress.org
on:
push:
tags:
- "**"
jobs:
tag:
name: New tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: composer

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache Composer vendor directory
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install PHP Dependencies
run: composer install --prefer-dist --no-progress --no-dev --optimize-autoloader --no-interaction

- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SLUG: ${{ secrets.SLUG }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
17 changes: 17 additions & 0 deletions .github/workflows/upateassets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Asset update
on:
push:
branches:
- master
jobs:
master:
name: Push to main
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: WordPress.org asset update
uses: 10up/action-wordpress-plugin-asset-update@stable
env:
SLUG: ${{ secrets.SLUG }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
67 changes: 0 additions & 67 deletions bin/release.sh

This file was deleted.

2 changes: 1 addition & 1 deletion bin/readme.txt → readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: json, rest, api, rest-api
Requires at least: 4.4
Requires PHP: 5.4
Tested up to: 6.4
Stable tag: {{TAG}}
Stable tag: 0.4.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down

0 comments on commit 1208bf3

Please sign in to comment.