diff --git a/README.md b/README.md index 63c0c07..1f8a42b 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,10 @@ This action installs Redmine and sets up an environment to run tests. It is prim See also [action.yml](./action.yml). +## Supported Redmine version + +v4.2 or later + ## Example ### Setting up [RedMica](https://github.com/redmica/redmica) diff --git a/action.yml b/action.yml index e767c81..fbe70d3 100644 --- a/action.yml +++ b/action.yml @@ -51,6 +51,16 @@ runs: env: REDMINE_DIR: ${{ inputs.path }} + - name: Check if the Redmine version is supported + run: | + if [ $redmine_version_number -lt $MINIUMUM_SUPPORTED_REDMINE_VERSION ]; then + echo "Redmine version $REDMINE_VERSION is not supported." + exit 1 + fi + shell: bash + env: + MINIUMUM_SUPPORTED_REDMINE_VERSION: "420" # v4.2.0 + - name: Set up base environment run: | setup_base_for_major_version="setup-base-$REDMINE_VERSION_MAJOR.$REDMINE_VERSION_MINOR.sh" diff --git a/scripts/set-version-envs.sh b/scripts/set-version-envs.sh index f7d2b72..eb91be9 100755 --- a/scripts/set-version-envs.sh +++ b/scripts/set-version-envs.sh @@ -9,9 +9,24 @@ version_minor=$(grep -oE 'MINOR *= *[0-9]+' $file | awk 'NR==1 {print $3}') version_tiny=$(grep -oE 'TINY *= *[0-9]+' $file | awk 'NR==1 {print $3}') version_branch=$(grep -oE 'BRANCH *= *'\''.+?' $file | awk -F"'" 'NR==1 {print $2}') -echo "Redmine Version: $version_major.$version_minor.$version_tiny.$version_branch" +redmine_version=$version_major.$version_minor.$version_tiny.$version_branch +redmine_version_number=$version_major$version_minor$version_tiny +# v5.1.3.stable -> 5.1.3.stable +echo "REDMINE_VERSION=$redmine_version" >> $GITHUB_ENV + +# v5.1.3.stable -> 5 echo "REDMINE_VERSION_MAJOR=$version_major" >> $GITHUB_ENV +# v5.1.3.stable -> 1 echo "REDMINE_VERSION_MINOR=$version_minor" >> $GITHUB_ENV +# v5.1.3.stable -> 3 echo "REDMINE_VERSION_TINY=$version_tiny" >> $GITHUB_ENV +# v5.1.3.stable -> stable echo "REDMINE_VERSION_BRANCH=$version_branch" >> $GITHUB_ENV + +# v5.1.3.stable -> 513 +echo "REDMINE_VERSION_NUMNER=$redmine_version_number" >> $GITHUB_ENV + +# Output version information +echo "Redmine Version: $redmine_version" +echo "Redmine Version Number: $redmine_version_number"