Skip to content

Commit 72fb70b

Browse files
authored
Merge pull request #74 from 10up/try/use-runner
Convert into a composite action
2 parents b3f8b3c + f72a4bf commit 72fb70b

3 files changed

Lines changed: 18 additions & 28 deletions

File tree

Dockerfile

Lines changed: 0 additions & 10 deletions
This file was deleted.

action.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
name: 'WordPress Plugin Deploy'
22
description: 'Deploy to the WordPress Plugin Repository'
33
author: '10up'
4+
branding:
5+
icon: 'upload-cloud'
6+
color: 'blue'
47
inputs:
58
generate-zip:
69
description: 'Generate package zip file?'
710
default: false
11+
outputs:
12+
zip-path:
13+
description: 'Path to zip file'
14+
value: ${{ steps.deploy.outputs.zip-path }}
815
runs:
9-
using: 'docker'
10-
image: 'Dockerfile'
11-
args:
12-
- ${{ inputs.generate-zip }}
13-
branding:
14-
icon: 'upload-cloud'
15-
color: 'blue'
16+
using: 'composite'
17+
steps:
18+
- id: deploy
19+
env:
20+
INPUT_GENERATE_ZIP: ${{ inputs.generate-zip }}
21+
run: ${{ github.action_path }}/deploy.sh
22+
shell: bash

entrypoint.sh renamed to deploy.sh

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ if [[ -z "$SVN_PASSWORD" ]]; then
2020
exit 1
2121
fi
2222

23-
# Set variables
24-
GENERATE_ZIP=false
25-
26-
# Set options based on user input
27-
if [ -z "$1" ]; then
28-
GENERATE_ZIP=$1;
29-
fi
30-
3123
# Allow some ENV variables to be customized
3224
if [[ -z "$SLUG" ]]; then
3325
SLUG=${GITHUB_REPOSITORY#*/}
@@ -47,7 +39,7 @@ fi
4739
echo "ℹ︎ ASSETS_DIR is $ASSETS_DIR"
4840

4941
SVN_URL="https://plugins.svn.wordpress.org/${SLUG}/"
50-
SVN_DIR="/github/svn-${SLUG}"
42+
SVN_DIR="${HOME}/svn-${SLUG}"
5143

5244
# Checkout just trunk and assets for efficiency
5345
# Tagging will be handled on the SVN level
@@ -69,7 +61,7 @@ else
6961
cd "$GITHUB_WORKSPACE"
7062

7163
# "Export" a cleaned copy to a temp directory
72-
TMP_DIR="/github/archivetmp"
64+
TMP_DIR="${HOME}/archivetmp"
7365
mkdir "$TMP_DIR"
7466

7567
git config --global user.email "10upbot+github@10up.com"
@@ -131,10 +123,11 @@ svn status
131123
echo "➤ Committing files..."
132124
svn commit -m "Update to version $VERSION from GitHub" --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
133125

134-
if ! $GENERATE_ZIP; then
126+
if $INPUT_GENERATE_ZIP; then
135127
echo "Generating zip file..."
136128
cd "$SVN_DIR/trunk" || exit
137129
zip -r "${GITHUB_WORKSPACE}/${SLUG}.zip" .
130+
echo "::set-output name=zip-path::${GITHUB_WORKSPACE}/${SLUG}.zip"
138131
echo "✓ Zip file generated!"
139132
fi
140133

0 commit comments

Comments
 (0)