Skip to content

Commit

Permalink
Merge pull request #160 from WP-API/wp-org-release-script
Browse files Browse the repository at this point in the history
Add release script and readme for .org release
  • Loading branch information
rmccue authored Oct 6, 2016
2 parents fcabdbb + 3e5e908 commit 339fa7b
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 1 deletion.
66 changes: 66 additions & 0 deletions bin/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# release.sh
#
# Takes a tag to release, and syncs it to WordPress.org

TAG=$1

PLUGIN="rest-api-oauth1"
TMPDIR=/tmp/rest-api-oauth1-release-svn
PLUGINDIR="$PWD"
PLUGINSVN="https://plugins.svn.wordpress.org/$PLUGIN"

# Fail on any error
set -e

# Is the tag valid?
if [ -z "$TAG" ] || ! git rev-parse "$TAG" > /dev/null; then
echo "Invalid tag. Make sure you tag before trying to release."
exit 1
fi

if [[ $VERSION == "v*" ]]; then
# Starts with an extra "v", strip for the version
VERSION=${TAG:1}
else
VERSION="$TAG"
fi

if [ -d "$TMPDIR" ]; then
# Wipe it clean
rm -r "$TMPDIR"
fi

# Ensure the directory exists first
mkdir "$TMPDIR"

# Grab an unadulterated copy of SVN
svn co "$PLUGINSVN/trunk" "$TMPDIR" > /dev/null

# Extract files from the Git tag to there
git archive --format="zip" -0 "$TAG" | tar -C "$TMPDIR" -xf -

# Switch to build dir
cd "$TMPDIR"

# Run build tasks
sed -e "s/{{TAG}}/$VERSION/g" < "$PLUGINDIR/bin/readme.txt" > readme.txt

# Remove special files
rm ".gitignore"
rm "composer.json"
rm "book.json"
rm -r "bin"
rm -r "docs"

# Add any new files
svn status | grep -v "^.[ \t]*\..*" | grep "^?" | awk '{print $2}' | xargs svn add

# Pause to allow checking
echo "About to commit $VERSION. Double-check $TMPDIR to make sure everything looks fine."
read -p "Hit Enter to continue."

# Commit the changes
svn commit -m "Tag $VERSION"

# tag_ur_it
svn copy "$PLUGINSVN/trunk" "$PLUGINSVN/tags/$VERSION" -m "Tag $VERSION"
15 changes: 15 additions & 0 deletions bin/release.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
=== WordPress REST API - OAuth 1.0a Server ===
Contributors: rmccue, rachelbaker, danielbachhuber, joehoyle
Tags: json, rest, api, rest-api
Requires at least: 4.4
Tested up to: 4.7-alpha
Stable tag: {{TAG}}
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

== Description ==
Connect applications to your WordPress site without ever giving away your password.

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.

This plugin only supports WordPress >= 4.4.
2 changes: 1 addition & 1 deletion oauth-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: WP REST API - OAuth 1.0a Server
* Description: Authenticate with your site via OAuth 1.0a
* Version: 0.2.1
* Version: 0.3.0
* Author: WP REST API Team
* Author URI: http://wp-api.org/
*
Expand Down

0 comments on commit 339fa7b

Please sign in to comment.