added deploy script
This commit is contained in:
parent
7cddec43b6
commit
8408374bce
4 changed files with 17 additions and 176 deletions
17
.github/workflows/deploy.yml
vendored
Normal file
17
.github/workflows/deploy.yml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
name: Deploy to WordPress.org
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
jobs:
|
||||
tag:
|
||||
name: New tag
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: WordPress Plugin Deploy
|
||||
uses: 10up/action-wordpress-plugin-deploy@master
|
||||
env:
|
||||
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
|
||||
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
|
||||
SLUG: activitypub
|
94
.travis.yml
94
.travis.yml
|
@ -1,94 +0,0 @@
|
|||
sudo: false
|
||||
dist: trusty
|
||||
language: php
|
||||
notifications:
|
||||
email:
|
||||
on_success: never
|
||||
on_failure: change
|
||||
cache:
|
||||
directories:
|
||||
- vendor
|
||||
- "$HOME/.composer/cache"
|
||||
after_success: bash bin/deploy.sh
|
||||
env:
|
||||
matrix:
|
||||
- WP_VERSION=latest WP_MULTISITE=0
|
||||
global:
|
||||
- WP_TRAVISCI=travis:phpunit
|
||||
- SVN_REPO: https://plugins.svn.wordpress.org/activitypub/
|
||||
- GH_REF: https://github.com/pfefferle/wordpress-activitypub.git
|
||||
- secure: "TFXc9CK6cG4Qpwm0sAhA0nEwMBfKKTdp3YN+rVV8KZrSmUDGw8QRlnFAxwWVG9yR1+TBVSS3Rrm38iRU8mvXkl5Vy6/HySqDF2QOO/gqhDZRpgCOq0mhxfzSc+tx2gGXbkRQw+eXt02p6VIHDi+bfll2rdvsE2XxkVgjvYJ+OMnfiqnESwac2+/rxii8qAvQwGnH/Cx7mpSFmt5KmRkR0XL05b9NEV+YkUpSQfSMx45IR2MZKlKAALTulDFIXvcwRMHSydgH8RoLDOioajgUzgFv1vBOWbCvdoHVvrNk2phtYgJ1yvOsMdKeb+Y5ZStag1HeKhZrzFMWJabe63N5Yukzo8gzU6doAPYaJ4CX6KaEEJoQyzxd5IUXZThNcnKStRVJbWngG850ROVCMg8rQYBQXr9HfeHMKGHCXzdXHc1zc13B5ycTL6pc0vWWys16Mdu8ivaPfk7qdnRZs2mpMeYZc4FoRy/xqavcyZX7kGnlONVcgoB4lP5eEQzu+wCWyjXcl4wrQfhCFCrS86jp1oLVUAS9GemPJRwVTWogEg+Rr5iMbWv6ZGh3F8fe5SEEAtThe8W9/hDC7NiZrbdA8hTyccRd91E7EEdCoZrTgc9VjKVkjxLjKHmocruevQQjafda5xsjRRZakAham9r9Rmfk4SH/4KBbWsFJlbHXZjE="
|
||||
matrix:
|
||||
include:
|
||||
- php: 7.4
|
||||
- php: 7.3
|
||||
- php: 7.2
|
||||
- php: 7.1
|
||||
- php: 7.0
|
||||
- php: 5.6
|
||||
- php: 5.6
|
||||
env: WP_PLUGIN_DEPLOY=1
|
||||
before_script:
|
||||
- |
|
||||
# Remove Xdebug for a huge performance increase:
|
||||
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
|
||||
phpenv config-rm xdebug.ini
|
||||
else
|
||||
echo "xdebug.ini does not exist"
|
||||
fi
|
||||
- |
|
||||
# Export Composer's global bin dir to PATH:
|
||||
composer config --list --global
|
||||
export PATH=`composer config --list --global | grep '\[home\]' | { read a; echo "${a#* }/vendor/bin:$PATH"; }`
|
||||
- |
|
||||
# Install the specified version of PHPUnit depending on the PHP version:
|
||||
if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
|
||||
case "$TRAVIS_PHP_VERSION" in
|
||||
5.6)
|
||||
echo "Using PHPUnit 5.x"
|
||||
composer global require "phpunit/phpunit:^5"
|
||||
;;
|
||||
*)
|
||||
echo "Using PHPUnit 6.x"
|
||||
composer global require "phpunit/phpunit:^6"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [[ "$WP_TRAVISCI" == "travis:phpcs" ]] ; then
|
||||
composer install
|
||||
fi
|
||||
- mysql --version
|
||||
- phpenv versions
|
||||
- php --version
|
||||
- php -m
|
||||
- which phpunit
|
||||
- phpunit --version
|
||||
- curl --version
|
||||
- grunt --version
|
||||
- git --version
|
||||
- svn --version
|
||||
- locale -a
|
||||
before_install:
|
||||
- export PATH="$HOME/.composer/vendor/bin:$PATH"
|
||||
- |
|
||||
if [[ ! -z "$WP_VERSION" ]] ; then
|
||||
set -e
|
||||
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
|
||||
set +e
|
||||
fi
|
||||
script:
|
||||
- |
|
||||
if [[ ! -z "$WP_VERSION" ]] ; then
|
||||
# Run the build because otherwise there will be a bunch of warnings about
|
||||
# failed `stat` calls from `filemtime()`.
|
||||
echo Running with the following versions:
|
||||
php -v
|
||||
phpunit --version
|
||||
# Run PHPUnit tests
|
||||
phpunit || exit 1
|
||||
WP_MULTISITE=1 phpunit || exit 1
|
||||
fi
|
||||
- |
|
||||
if [[ "$WP_TRAVISCI" == "travis:phpcs" ]] ; then
|
||||
./vendor/bin/phpcs -p -s -v -n --standard=./phpcs.ruleset.xml --extensions=php
|
||||
fi
|
|
@ -1,82 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
if [[ "false" != "$TRAVIS_PULL_REQUEST" ]]; then
|
||||
echo "Not deploying pull requests."
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ ! $WP_PLUGIN_DEPLOY ]]; then
|
||||
echo "Not deploying."
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ ! $SVN_REPO ]]; then
|
||||
echo "SVN repo is not specified."
|
||||
exit
|
||||
fi
|
||||
|
||||
# Untrailing slash of SVN_REPO path
|
||||
SVN_REPO=`echo $SVN_REPO | sed -e "s/\/$//"`
|
||||
# Git repository
|
||||
GH_REF=https://github.com/${TRAVIS_REPO_SLUG}.git
|
||||
|
||||
echo "Starting deploy..."
|
||||
|
||||
mkdir build
|
||||
|
||||
cd build
|
||||
BASE_DIR=$(pwd)
|
||||
|
||||
echo "Checking out trunk from $SVN_REPO ..."
|
||||
svn co -q $SVN_REPO/trunk
|
||||
|
||||
echo "Getting clone from $GH_REF to $SVN_REPO ..."
|
||||
git clone -q $GH_REF ./git
|
||||
|
||||
cd ./git
|
||||
|
||||
if [ -e "bin/build.sh" ]; then
|
||||
echo "Starting bin/build.sh."
|
||||
bash bin/build.sh
|
||||
fi
|
||||
|
||||
cd $BASE_DIR
|
||||
|
||||
echo "Syncing git repository to svn"
|
||||
rsync -a --exclude=".svn" --checksum --delete ./git/ ./trunk/
|
||||
rm -fr ./git
|
||||
|
||||
cd ./trunk
|
||||
|
||||
if [ -e ".distignore" ]; then
|
||||
echo "svn propset form .distignore"
|
||||
svn propset -q -R svn:ignore -F .distignore .
|
||||
|
||||
else
|
||||
if [ -e ".svnignore" ]; then
|
||||
echo "svn propset"
|
||||
svn propset -q -R svn:ignore -F .svnignore .
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Run svn del"
|
||||
svn st | grep '^!' | sed -e 's/\![ ]*/svn del -q /g' | sh
|
||||
echo "Run svn add"
|
||||
svn st | grep '^?' | sed -e 's/\?[ ]*/svn add -q /g' | sh
|
||||
|
||||
# If tag number and credentials are provided, commit to trunk.
|
||||
if [[ $TRAVIS_TAG && $SVN_USER && $SVN_PASS ]]; then
|
||||
if [[ ! -d tags/$TRAVIS_TAG ]]; then
|
||||
echo "Commit to $SVN_REPO."
|
||||
svn commit -m "commit version $TRAVIS_TAG" --username $SVN_USER --password $SVN_PASS --non-interactive 2>/dev/null
|
||||
echo "Take snapshot of $TRAVIS_TAG"
|
||||
svn copy $SVN_REPO/trunk $SVN_REPO/tags/$TRAVIS_TAG -m "Take snapshot of $TRAVIS_TAG" --username $SVN_USER --password $SVN_PASS --non-interactive 2>/dev/null
|
||||
else
|
||||
echo "tags/$TRAVIS_TAG already exists."
|
||||
fi
|
||||
else
|
||||
echo "Nothing to commit and check \`svn st\`."
|
||||
svn st
|
||||
fi
|
Loading…
Reference in a new issue