-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
81 lines (81 loc) · 3.4 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: 'Deploy to WordPress.org / SVN repository'
description: 'Deploy WordPress Plugin to SVN repository'
author: 'richard-muvirimi'
branding:
icon: 'upload-cloud'
color: 'blue'
inputs:
svn-username:
description: 'SVN repository username.'
required: true
svn-password:
description: 'SVN repository password.'
required: true
plugin-repository:
description: 'The svn repository name (slug) of the plugin on WordPress.org. Can be a full url to use a custom repository. Defaults to git repository name if empty. Default empty.'
default: ""
type: string
plugin-zip:
description: 'Zip file name to generate, any custom text to name differently, "slug" (default) to use plugin slug. set empty to disable. ".zip" will be automatically appended.'
default: 'slug'
type: string
plugin-zip-folder:
description: 'Folder name to use at root of zip, "slug" to use plugin slug, set empty to disable.'
default: ''
type: string
plugin-version:
description: 'Tag for releasing to WordPress, any custom text to use a custom tag, "tag" to read from release tags, "readme" (default) to obtain from readme.txt.'
default: 'readme'
type: string
required: true
commit-message:
description: 'Commit message for releasing to WordPress, any custom text to use a custom message, "git" (default) to use the last git commit message. Substitutes ":VERSION" with provided/inferred plugin version.'
default: 'git'
type: string
working-directory:
description: 'Working directory, defaults to $GITHUB_WORKSPACE if empty. All files in working directory will be committed, except those in "assets-directory" directory. Default empty.'
default: ""
type: string
assets-directory:
description: 'Directory containing plugin assets, defaults to ".wordpress-org", set empty to disable.'
default: '.wordpress-org'
type: string
outputs:
plugin-zip:
description: 'Path to generated plugin zip file, if "plugin-zip" was set.'
value: ${{ steps.deploy-zip.outputs.plugin-zip }}
plugin-version:
description: 'The version tag used to commit to "plugin-repository".'
value: ${{ steps.deploy.outputs.plugin-version }}
commit-message:
description: 'The message used to commit to "plugin-repository".'
value: ${{ steps.deploy.outputs.commit-message }}
runs:
using: 'composite'
steps:
- id: setup
run: |
sudo apt update
sudo apt install -y subversion rsync zip
shell: bash
- id: deploy
env:
INPUT_SVN_USERNAME: ${{ inputs.svn-username }}
INPUT_SVN_PASSWORD: ${{ inputs.svn-password }}
INPUT_PLUGIN_REPOSITORY: ${{ inputs.plugin-repository }}
INPUT_PLUGIN_VERSION: ${{ inputs.plugin-version }}
INPUT_COMMIT_MESSAGE: ${{ inputs.commit-message }}
INPUT_WORKING_DIRECTORY: ${{ inputs.working-directory }}
INPUT_ASSETS_DIRECTORY: ${{ inputs.assets-directory }}
run: sh ${{ github.action_path }}/deploy.sh
shell: bash
- id: deploy-zip
if: ${{ env.INPUT_PLUGIN_ZIP != false }}
env:
INPUT_PLUGIN_ZIP: ${{ inputs.plugin-zip }}
INPUT_PLUGIN_ZIP_FOLDER: ${{ inputs.plugin-zip-folder }}
INPUT_PLUGIN_REPOSITORY: ${{ inputs.plugin-repository }}
INPUT_WORKING_DIRECTORY: ${{ inputs.working-directory }}
INPUT_ASSETS_DIRECTORY: ${{ inputs.assets-directory }}
run: sh ${{ github.action_path }}/deploy-zip.sh
shell: bash