-
Notifications
You must be signed in to change notification settings - Fork 11
/
deploy.sh
44 lines (32 loc) · 1.18 KB
/
deploy.sh
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
#!/usr/bin/env bash
# https://zerowp.com/?p=55
# Get the plugin slug from this git repository.
PLUGIN_SLUG="billmate-payment-gateway-for-woocommerce"
# Get the current release version
TAG=$(sed -e "s/refs\/tags\///g" <<< $GITHUB_REF)
# Replace the version in these 2 files.
sed -i -e "s/__STABLE_TAG__/$TAG/g" ./src/Readme.txt
sed -i -e "s/__STABLE_TAG__/$TAG/g" "./src/gateway-billmate.php"
# Get the SVN data from wp.org in a folder named `svn`
svn co --depth immediates "https://plugins.svn.wordpress.org/$PLUGIN_SLUG" ./svn
svn update --set-depth infinity ./svn/trunk
svn update --set-depth infinity ./svn/assets
svn update --set-depth infinity ./svn/tags/$TAG
# Copy files from `src` to `svn/trunk`
cp -R ./src/* ./svn/trunk
# Copy the images from `assets` to `svn/assets`
cp -R ./assets/* ./svn/assets
# 3. Switch to SVN directory
cd ./svn
# Prepare the files for commit in SVN
svn add --force trunk
svn add --force assets
# Create the version tag in svn
svn cp trunk tags/$TAG
# Prepare the tag for commit
svn add --force tags
# Commit files to wordpress.org.
svn ci --message "Release $TAG" \
--username $SVN_USERNAME \
--password $SVN_PASSWORD \
--non-interactive