Skip to content
This repository was archived by the owner on Jun 25, 2021. It is now read-only.

Commit 1c943ea

Browse files
authored
Merge pull request #4 from WP-API/wp-org-release-script
Add release script and readme
2 parents 010669c + 585bb7e commit 1c943ea

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

bin/readme.txt

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
=== WordPress REST API - Authentication Broker ===
2+
Contributors: rmccue, rachelbaker, danielbachhuber, joehoyle
3+
Tags: json, rest, api, rest-api, oauth, oauth1, broker
4+
Requires at least: 4.4
5+
Tested up to: 4.7-alpha
6+
Stable tag: {{TAG}}
7+
License: GPLv2 or later
8+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9+
10+
== Description ==
11+
Used together with the [WP REST API OAuth 1.0a Server plugin](https://github.com/WP-API/OAuth1), this allows [the WP RET API Authentication Broker](https://apps.wp-api.org/)
12+
to connect to your site.
13+
14+
Read about how it works [on the reference broker](https://apps.wp-api.org/), or [read the full specification](https://apps.wp-api.org/spec/).
15+
16+
== Installation ==
17+
Install this plugin onto your site to opt-in to the Broker Authentication system. This plugin requires [the OAuth Server plugin](https://github.com/WP-API/OAuth1).

bin/release.sh

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# release.sh
2+
#
3+
# Takes a tag to release, and syncs it to WordPress.org
4+
5+
TAG=$1
6+
7+
PLUGIN="rest-api-broker"
8+
TMPDIR=/tmp/rest-api-broker-release-svn
9+
PLUGINDIR="$PWD"
10+
PLUGINSVN="https://plugins.svn.wordpress.org/$PLUGIN"
11+
12+
# Fail on any error
13+
set -e
14+
15+
# Is the tag valid?
16+
if [ -z "$TAG" ] || ! git rev-parse "$TAG" > /dev/null; then
17+
echo "Invalid tag. Make sure you tag before trying to release."
18+
exit 1
19+
fi
20+
21+
if [[ $VERSION == "v*" ]]; then
22+
# Starts with an extra "v", strip for the version
23+
VERSION=${TAG:1}
24+
else
25+
VERSION="$TAG"
26+
fi
27+
28+
if [ -d "$TMPDIR" ]; then
29+
# Wipe it clean
30+
rm -r "$TMPDIR"
31+
fi
32+
33+
# Ensure the directory exists first
34+
mkdir "$TMPDIR"
35+
36+
# Grab an unadulterated copy of SVN
37+
svn co "$PLUGINSVN/trunk" "$TMPDIR" > /dev/null
38+
39+
# Extract files from the Git tag to there
40+
git archive --format="zip" -0 "$TAG" | tar -C "$TMPDIR" -xf -
41+
42+
# Switch to build dir
43+
cd "$TMPDIR"
44+
45+
# Run build tasks
46+
sed -e "s/{{TAG}}/$VERSION/g" < "$PLUGINDIR/bin/readme.txt" > readme.txt
47+
48+
# Remove special files
49+
rm -r "bin"
50+
51+
# Add any new files
52+
svn status | grep -v "^.[ \t]*\..*" | grep "^?" | awk '{print $2}' | xargs svn add
53+
54+
# Pause to allow checking
55+
echo "About to commit $VERSION. Double-check $TMPDIR to make sure everything looks fine."
56+
read -p "Hit Enter to continue."
57+
58+
# Commit the changes
59+
svn commit -m "Tag $VERSION"
60+
61+
# tag_ur_it
62+
svn copy "$PLUGINSVN/trunk" "$PLUGINSVN/tags/$VERSION" -m "Tag $VERSION"

0 commit comments

Comments
 (0)