Skip to content

Commit 339fa7b

Browse files
authored
Merge pull request #160 from WP-API/wp-org-release-script
Add release script and readme for .org release
2 parents fcabdbb + 3e5e908 commit 339fa7b

File tree

3 files changed

+82
-1
lines changed

3 files changed

+82
-1
lines changed

bin/release.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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-oauth1"
8+
TMPDIR=/tmp/rest-api-oauth1-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 ".gitignore"
50+
rm "composer.json"
51+
rm "book.json"
52+
rm -r "bin"
53+
rm -r "docs"
54+
55+
# Add any new files
56+
svn status | grep -v "^.[ \t]*\..*" | grep "^?" | awk '{print $2}' | xargs svn add
57+
58+
# Pause to allow checking
59+
echo "About to commit $VERSION. Double-check $TMPDIR to make sure everything looks fine."
60+
read -p "Hit Enter to continue."
61+
62+
# Commit the changes
63+
svn commit -m "Tag $VERSION"
64+
65+
# tag_ur_it
66+
svn copy "$PLUGINSVN/trunk" "$PLUGINSVN/tags/$VERSION" -m "Tag $VERSION"

bin/release.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
=== WordPress REST API - OAuth 1.0a Server ===
2+
Contributors: rmccue, rachelbaker, danielbachhuber, joehoyle
3+
Tags: json, rest, api, rest-api
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+
Connect applications to your WordPress site without ever giving away your password.
12+
13+
This plugin uses the OAuth 1.0a protocol to allow delegated authorization; that is, to allow applications to access a site using a set of secondary credentials. This allows server administrators to control which applications can access the site, as well as allowing users to control which applications have access to their data.
14+
15+
This plugin only supports WordPress >= 4.4.

oauth-server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Plugin Name: WP REST API - OAuth 1.0a Server
44
* Description: Authenticate with your site via OAuth 1.0a
5-
* Version: 0.2.1
5+
* Version: 0.3.0
66
* Author: WP REST API Team
77
* Author URI: http://wp-api.org/
88
*

0 commit comments

Comments
 (0)