-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
45 lines (43 loc) · 1.66 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
language: generic
before_deploy:
- if ! [ "$BEFORE_DEPLOY_RUN" ]; then
export BEFORE_DEPLOY_RUN=1;
git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs;
git clone -b master https://github.com/WordPress/WordPress-Coding-Standards.git wpcs;
cd phpcs;
./bin/phpcs --config-set installed_paths ../wpcs;
cd ../;
mkdir build;
mkdir build/src;
rsync -r --exclude 'build' --exclude 'wpcs' --exclude 'phpcs' --exclude '.git' --exclude '.travis.yml' --exclude 'README.md' . build/src;
perl -plne 'print "$ENV{'FEATURES'}" if(/== Installation ==/); print "$ENV{'FAQ_ENTRIES'}" if(/== Changelog ==/);' build/src/readme.txt > build/src/readme_mod.txt;
rm build/src/readme.txt;
mv build/src/readme_mod.txt build/src/readme.txt;
mkdir build/$WORDPRESS_ORG_SLUG;
rsync -r build/src/ build/$WORDPRESS_ORG_SLUG/;
cd build;
zip -r $TRAVIS_BUILD_DIR/$WORDPRESS_ORG_SLUG.zip $WORDPRESS_ORG_SLUG;
rm -rf src/docs;
../phpcs/bin/phpcbf -n --standard=WordPress src/ --ignore=/src/$TRAVIS_WHITELABEL-sdk || true;
../phpcs/bin/phpcs -n --standard=WordPress src/ --ignore=/src/$TRAVIS_WHITELABEL-sdk || true;
cd ..;
fi
deploy:
- provider: releases
api_key: $GITHUB_API_KEY
file: "$WORDPRESS_ORG_SLUG.zip"
skip_cleanup: true
on:
tags: true
- provider: wordpress-plugin
edge:
source: TypistTech/dpl
branch: add-wordpress-plugin-deployment
on:
tags: true
repo: pfpayments/woocommerce
skip_cleanup: true
slug: $WORDPRESS_ORG_SLUG
username: $WORDPRESS_ORG_USERNAME
password: $WORDPRESS_ORG_PASSWORD
build_dir: build/src