Skip to content

[ Change version ] 1.7.4.3 / ゴミファイルをアップしないように #26

[ Change version ] 1.7.4.3 / ゴミファイルをアップしないように

[ Change version ] 1.7.4.3 / ゴミファイルをアップしないように #26

name: Deploy to WordPress.org
on:
push:
tags:
- "*"
env:
plugin_name: vk-link-target-controller
jobs:
php_unit:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.1']
wp-versions: ['6.5']
name: PHP Unit Test on PHP ${{ matrix.php-versions }} / WP ${{ matrix.wp-versions }} Test
services:
mysql:
image: mysql:5.7
ports:
- 3306
env:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
steps:
- uses: actions/checkout@v3
- name: Read .node-version
run: echo "{NODEVERSION}={$(cat .node-version)}" >> $GITHUB_OUTPUT
id: nodenv
- name: Setup Node.js (.node-version)
uses: actions/setup-node@v3
with:
node-version: '${{ steps.nodenv.outputs.NODEVERSION }}'
- name: Cache multiple paths
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: install npm scripts
run: npm install
- name: Install Composer Packages
run: composer install
- name: Install WP-CLI
run: |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
- name: Install several WordPress version by wp-env.override.json
run: WP_ENV_PHP_VERSION=${{ matrix.php-versions }} WP_ENV_CORE=WordPress/WordPress#${{ matrix.wp-versions }} npm run wp-env start --update
- name: Check WordPress Version
run: npm run wp-env run cli wp core version
- name: Install Themes
run: bash bin/install-theme.sh
- name: Build
run: npm run build
- name: Start Environment
run: npx wp-env start && sudo chmod -R 777 ~/wp-env
- name: Run PHP Unit Test
run: npm run phpunit
deploy:
name: deploy to plugin directory
runs-on: ubuntu-latest
needs: [php_unit]
steps:
- uses: actions/checkout@master
- name: Read .node-version
run: echo "##[set-output name=NODEVERSION;]$(cat .node-version)"
id: nodenv
- name: Setup Node.js (.node-version)
uses: actions/setup-node@v1
with:
node-version: '${{ steps.nodenv.outputs.NODEVERSION }}'
- name: Setup PHP 7.4
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
- name: install npm scripts
run: npm install
- name: Build
run: npm run build
- name: Install Composer Packages
run: composer install --optimize-autoloader --prefer-dist --no-dev
- name: Deploy
run: bash bin/deploy.sh
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@master
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: ${{ env.plugin_name }}