diff --git a/README.md b/README.md index e5309af..46a7a41 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,12 @@ The file will be in your GitHub workspace after the action is run. **Required** Name of plugin, should almost always be the repo name, e.g. `koha-plugin-kitchen-sink` +### `minimmum-version` + +**Required** Minimum version of Koha this plugin is compatible with, e.g. `19.11` or `19.11.03` + +Best practice is to keep plugins compatible across all currently supported versions of Koha + ## Outputs ### `filename` @@ -28,6 +34,7 @@ The name of the built kpz file with: release-version: ${{ steps.semvers.outputs.v_patch }} release-name: ${{ steps.myvars.outputs.GITHUB_REPO }} + minimum-version: ${{ steps.myvars.outputs.MINIMUM_VERSION }} ``` Take a look at https://github.com/bywatersolutions/koha-plugin-kitchen-sink/blob/master/.github/workflows/main.yml for a real world usage. diff --git a/action.yml b/action.yml index b2b1eb0..a3fece8 100644 --- a/action.yml +++ b/action.yml @@ -10,6 +10,8 @@ inputs: release-name: description: 'Name of plugin repo, e.g. koha-plugin-kitchen-sink' required: true + minimum-version: + description: 'Minimum version of Koha this plugin is compatible with e.g. 19.11' outputs: filename: # id of output description: 'The name of the built kpz file' diff --git a/entrypoint.sh b/entrypoint.sh index 7181fa0..1d3fdd7 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,6 +2,7 @@ PLUGIN_VERSION=$1 PLUGIN_NAME=$2 +MINIMUM_VERSION=$3 RELEASE_FILENAME="${PLUGIN_NAME}-${PLUGIN_VERSION}.kpz" TODAY_ISO=$(date '+%Y-%m-%d') @@ -15,10 +16,12 @@ PLUGIN_MODULE=$(find . -regex '\./Koha/Plugin/.*[A-Za-z]*\.pm$' | sed '1q;d') META_YML=$(find . -regex '\./Koha/Plugin/.*[A-Za-z]*/META\.yml$' | sed '1q;d') sed -i -e "s/{VERSION}/${PLUGIN_VERSION}/g" ${PLUGIN_MODULE} +sed -i -e "s/{MINIMUM_VERSION}/${MINIMUM_VERSION}/g" ${PLUGIN_MODULE} sed -i -e "s/1900-01-01/${TODAY_ISO}/g" $PLUGIN_MODULE if [ -f "$META_YML" ]; then sed -i -e "s/{VERSION}/${PLUGIN_VERSION}/g" ${META_YML} + sed -i -e "s/{MINIMUM_VERSION}/${MINIMUM_VERSION}/g" ${META_YML} sed -i -e "s/1900-01-01/${TODAY_ISO}/g" $META_YML cat $META_YML fi @@ -27,6 +30,7 @@ zip -r ../${RELEASE_FILENAME} ./Koha cd .. rm -rf dist +echo "MINIMUM VERSION: $MINIMUM_VERSION" echo "PLUGIN VERSION: $PLUGIN_VERSION" echo "PLUGIN NAME: $PLUGIN_NAME" echo "TODAY ISO: $TODAY_ISO"