-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from WP-API/wp-org-release-script
Add release script and readme for .org release
- Loading branch information
Showing
3 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters