Skip to content

Commit

Permalink
Merge branch 'develop' for 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
helen committed Mar 10, 2020
2 parents 07557c1 + cc8f3f1 commit d1a9816
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
13 changes: 1 addition & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
FROM debian:stable-slim

LABEL "com.github.actions.name"="WordPress Plugin Deploy"
LABEL "com.github.actions.description"="Deploy to the WordPress Plugin Repository"
LABEL "com.github.actions.icon"="upload-cloud"
LABEL "com.github.actions.color"="blue"

LABEL maintainer="Helen Hou-Sandí <[email protected]>"
LABEL version="1.2.1"
LABEL repository="http://github.com/helen/action-wordpress-plugin-deploy"

RUN apt-get update \
&& apt-get install -y subversion rsync git \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& git config --global user.email "[email protected]" \
&& git config --global user.name "10upbot on GitHub"
&& rm -rf /var/lib/apt/lists/*

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This Action commits the contents of your Git tag to the WordPress.org plugin rep
* `SVN_USERNAME`
* `SVN_PASSWORD`

[Secrets are set in your repository settings](https://help.github.com/en/articles/virtual-environments-for-github-actions#creating-and-using-secrets-encrypted-variables). They cannot be viewed once stored.
[Secrets are set in your repository settings](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets). They cannot be viewed once stored.

### Optional environment variables
* `SLUG` - defaults to the repository name, customizable in case your WordPress repository has a different slug or is capitalized differently.
Expand Down
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'WordPress Plugin Deploy'
description: 'Deploy to the WordPress Plugin Repository'
author: '10up'
runs:
using: 'docker'
image: 'Dockerfile'
branding:
icon: 'upload-cloud'
color: 'blue'
12 changes: 6 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ echo "ℹ︎ SLUG is $SLUG"

# Does it even make sense for VERSION to be editable in a workflow definition?
if [[ -z "$VERSION" ]]; then
VERSION=${GITHUB_REF#refs/tags/}
VERSION=$(echo $VERSION | sed -e "s/^v//")
VERSION="${GITHUB_REF#refs/tags/}"
VERSION="${VERSION#v}"
fi
echo "ℹ︎ VERSION is $VERSION"

Expand All @@ -38,7 +38,7 @@ if [[ -z "$ASSETS_DIR" ]]; then
fi
echo "ℹ︎ ASSETS_DIR is $ASSETS_DIR"

SVN_URL="http://plugins.svn.wordpress.org/${SLUG}/"
SVN_URL="https://plugins.svn.wordpress.org/${SLUG}/"
SVN_DIR="/github/svn-${SLUG}"

# Checkout just trunk and assets for efficiency
Expand All @@ -54,7 +54,7 @@ if [[ -e "$GITHUB_WORKSPACE/.distignore" ]]; then
echo "ℹ︎ Using .distignore"
# Copy from current branch to /trunk, excluding dotorg assets
# The --delete flag will delete anything in destination that no longer exists in source
rsync -rc --exclude-from="$GITHUB_WORKSPACE/.distignore" "$GITHUB_WORKSPACE/" trunk/ --delete
rsync -rc --exclude-from="$GITHUB_WORKSPACE/.distignore" "$GITHUB_WORKSPACE/" trunk/ --delete --delete-excluded
else
echo "ℹ︎ Using .gitattributes"

Expand Down Expand Up @@ -89,7 +89,7 @@ else

# Copy from clean copy to /trunk, excluding dotorg assets
# The --delete flag will delete anything in destination that no longer exists in source
rsync -rc "$TMP_DIR/" trunk/ --delete
rsync -rc "$TMP_DIR/" trunk/ --delete --delete-excluded
fi

# Copy dotorg assets to /assets
Expand All @@ -107,7 +107,7 @@ svn add . --force > /dev/null

# SVN delete all deleted files
# Also suppress stdout here
svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm % > /dev/null
svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm %@ > /dev/null

# Copy tag locally to make this a single commit
echo "➤ Copying tag..."
Expand Down

0 comments on commit d1a9816

Please sign in to comment.