Add ability to specify the plugin module manually
This commit is contained in:
parent
e67b62bef1
commit
2fbd14329c
@ -17,6 +17,10 @@ The file will be in your GitHub workspace after the action is run.
|
||||
|
||||
**Required** Minimum version of Koha this plugin is compatible with, e.g. `19.11` or `19.11.03`
|
||||
|
||||
### `plugin-module`
|
||||
|
||||
**Optional** Path to the plugin module file, relative to the plugin root directory. If not provided, action will attempt to auto-detect the module path.
|
||||
|
||||
Best practice is to keep plugins compatible across all currently supported versions of Koha
|
||||
|
||||
## Outputs
|
||||
@ -35,6 +39,7 @@ The name of the built kpz file
|
||||
release-version: ${{ steps.semvers.outputs.v_patch }}
|
||||
release-name: ${{ steps.myvars.outputs.GITHUB_REPO }}
|
||||
minimum-version: ${{ steps.koha-version-oldstable.outputs.version-major-minor }}
|
||||
plugin-module: 'Path/To/Plugin/Module.pm"
|
||||
```
|
||||
|
||||
Take a look at https://github.com/bywatersolutions/koha-plugin-kitchen-sink/blob/master/.github/workflows/main.yml for a real world usage.
|
||||
|
@ -12,6 +12,8 @@ inputs:
|
||||
required: true
|
||||
minimum-version:
|
||||
description: 'Minimum version of Koha this plugin is compatible with e.g. 19.11'
|
||||
plugin-module:
|
||||
description: 'Path to the plugin module relative to the plugin directory root, e.g. Koha/Plugin/Com/ByWaterSolutions/CurbsidePickup.pm'
|
||||
outputs:
|
||||
filename: # id of output
|
||||
description: 'The name of the built kpz file'
|
||||
@ -22,3 +24,4 @@ runs:
|
||||
- ${{ inputs.release-version }}
|
||||
- ${{ inputs.release-name }}
|
||||
- ${{ inputs.minimum-version }}
|
||||
- ${{ inputs.plugin-module }}
|
||||
|
@ -3,6 +3,7 @@
|
||||
PLUGIN_VERSION=$1
|
||||
PLUGIN_NAME=$2
|
||||
MINIMUM_VERSION=$3
|
||||
PLUGIN_MODULE=$4
|
||||
|
||||
echo "PLUGIN VERSION: $PLUGIN_VERSION"
|
||||
echo "PLUGIN NAME: $PLUGIN_NAME"
|
||||
@ -19,7 +20,7 @@ mkdir dist
|
||||
cp -r Koha dist/.
|
||||
cd dist
|
||||
|
||||
PLUGIN_MODULE=$(find . -regex '\./Koha/Plugin/.*[A-Za-z]*\.pm$' | tail -1 | sed '1q;d')
|
||||
[ -z "$PLUGIN_MODULE" ] && PLUGIN_MODULE=$(find . -regex '\./Koha/Plugin/.*[A-Za-z]*\.pm$' | tail -1 | sed '1q;d')
|
||||
echo "PLUGIN MODULE: $PLUGIN_MODULE"
|
||||
PLUGIN_YML=$(find . -regex '\./Koha/Plugin/.*[A-Za-z]*/PLUGIN\.yml$' | sed '1q;d')
|
||||
|
||||
@ -52,7 +53,7 @@ else
|
||||
fi
|
||||
|
||||
zip -r ../${RELEASE_FILENAME} ./Koha
|
||||
cp ${PLUGIN_YML} .. # Copy munged PLUGIN.yml to the root directory
|
||||
[ -z "$PLUGIN_YML" ] || cp ${PLUGIN_YML} .. # Copy munged PLUGIN.yml to the root directory
|
||||
cd ..
|
||||
rm -rf dist
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user