-
Notifications
You must be signed in to change notification settings - Fork 6
76 lines (70 loc) · 2.88 KB
/
woo-publish.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Release Plugin
on:
push:
tags:
- '*'
jobs:
tag:
name: New release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup
env:
WORDPRESS_ORG_SLUG: ${{ vars.WORDPRESS_ORG_SLUG }}
WHITELABEL: ${{ vars.WHITELABEL_NAME }}
FAQ_ENTRIES: ${{ vars.FAQ_ENTRIES }}
FEATURES: ${{ vars.FEATURES }}
# sleep 90 is required, because gradle release command takes around 65s, we should start upload zip file after it finishes
# zip file is attached when pipeline is finished
run: |
echo $GITHUB_WORKSPACE
echo $WORDPRESS_ORG_SLUG
ls -ltrh
git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs;
git clone -b main https://github.com/WordPress/WordPress-Coding-Standards.git wpcs;
cd phpcs;
./bin/phpcs --config-set installed_paths ../wpcs;
cd ../;
ls -ltrh
pwd
mkdir -p $GITHUB_WORKSPACE/build-woo/src;
rsync -r --exclude 'build-woo' --exclude 'wpcs' --exclude 'phpcs' --exclude '.git' --exclude '.github' --exclude '.travis.yml' --exclude 'README.md' . $GITHUB_WORKSPACE/build-woo/src;
perl -plne 'print "$ENV{'FEATURES'}" if(/== Installation ==/); print "$ENV{'FAQ_ENTRIES'}" if(/== Changelog ==/);' $GITHUB_WORKSPACE/build-woo/src/readme.txt > $GITHUB_WORKSPACE/build-woo/src/readme_mod.txt;
mv build-woo/src/readme_mod.txt build-woo/src/readme.txt;
mkdir build-woo/$WORDPRESS_ORG_SLUG;
rsync -r build-woo/src/ build-woo/$WORDPRESS_ORG_SLUG/;
- name: Zip & Sniff
env:
WORDPRESS_ORG_SLUG: ${{ vars.WORDPRESS_ORG_SLUG }}
WHITELABEL: ${{ vars.WHITELABEL_NAME }}
run: |
ls -ltrh;
cd $GITHUB_WORKSPACE/build-woo/
zip -r $GITHUB_WORKSPACE/$WORDPRESS_ORG_SLUG.zip $WORDPRESS_ORG_SLUG;
rm -rf src/docs;
../phpcs/bin/phpcbf -n --standard=WordPress src/ --ignore=/src/$WHITELABEL-sdk || true;
../phpcs/bin/phpcs -n --standard=WordPress src/ --ignore=/src/$WHITELABEL-sdk || true;
- name: Upload binaries to Github release
uses: svenstaro/upload-release-action@v2
with:
file: ${{ vars.WORDPRESS_ORG_SLUG }}.zip
asset_name: ${{ vars.WORDPRESS_ORG_SLUG }}
tag: ${{ github.ref }}
draft: true
promote: true
prerelease: true
overwrite: true
# - name: WordPress Plugin Deploy
# id: deploy
# # does not deploy if it's testing repo
# if: ${{ vars.WORDPRESS_ORG_SLUG != 'woo-WhiteLabelGithubOwnerName' }}
# uses: 10up/action-wordpress-plugin-deploy@stable
# with:
# generate-zip: true
# env:
# SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
# SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
# ASSETS_DIR: ${{ vars.WORDPRESS_ORG_SLUG }}/build-woo/src
# SLUG: ${{ vars.WORDPRESS_ORG_SLUG }}