diff --git a/README.md b/README.md index 6b8542f..7308774 100644 --- a/README.md +++ b/README.md @@ -28,13 +28,13 @@ GitHub variable is `Linux`, `macOS`, or `Windows`. runs-on: ubuntu-latest steps: - name: Install Senzing API - uses: senzing-factory/github-action-install-senzing-api@v2 + uses: senzing-factory/github-action-install-senzing-api@v3 with: senzingapi-version: production-v3 ``` 1. An example `.github/workflows/install-senzing-example.yaml` file - which installs a specific Senzing API verson: + which installs a specific Senzing API version: ```yaml name: install senzing example @@ -46,11 +46,47 @@ GitHub variable is `Linux`, `macOS`, or `Windows`. runs-on: ubuntu-latest steps: - name: Install Senzing API - uses: senzing-factory/github-action-install-senzing-api@v2 + uses: senzing-factory/github-action-install-senzing-api@v3 with: senzingapi-version: 3.6.0-23160 ``` +1. An example `.github/workflows/install-senzing-example.yaml` file + which installs senzingapi-runtime and senzingapi-setup with a + specific Senzing API semantic version: + + ```yaml + name: install senzing example + + on: [push] + + jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Install Senzing API + uses: senzing-factory/github-action-install-senzing-api@v3 + with: + package(s)-to-install: "senzingapi-runtime senzingapi-setup" + senzingapi-version: 3.12.0 + ``` + +### package(s)-to-install + +`package(s)-to-install` values can include the following: + +- Version <= 3.X: + - `senzingapi` + - `senzingapi-runtime` + - `senzingapi-setup` + - `senzingapi-tools` + - `senzingdata-v` +- Version >= 4.0: + - `senzingapi-poc` + - `senzingapi-runtime` + - `senzingapi-setup` + - `senzingapi-tools` + ### senzingapi-version `senzingapi-version` values can include the following: diff --git a/action.yaml b/action.yaml index daaa8fb..ef52c03 100644 --- a/action.yaml +++ b/action.yaml @@ -3,9 +3,12 @@ description: Install Senzing API Runtime based on platform. author: support@senzing.com inputs: - senzingapi-runtime-version: + package(s)-to-install: + description: Space separated list of Senzing packages to install. Linux only. + default: "senzingapi-runtime" + senzingapi-version: description: Version of Senzing API to install - required: true + default: "production-v3" runs: using: composite @@ -14,7 +17,8 @@ runs: name: Run on Linux uses: senzing-factory/github-action-install-senzing-api/linux@v3 with: - senzingapi-runtime-version: ${{ inputs.senzingapi-runtime-version }} + senzingapi-version: ${{ inputs.senzingapi-version }} + package(s)-to-install: ${{ inputs.package(s)-to-install }} - if: runner.os == 'macOS' name: Run on macOS diff --git a/linux/action.yaml b/linux/action.yaml index c2ac0ee..ca4f4a2 100644 --- a/linux/action.yaml +++ b/linux/action.yaml @@ -3,9 +3,12 @@ description: Install Senzing API Runtime on the linux platform. author: support@senzing.com inputs: - senzingapi-runtime-version: - description: Version of Senzing API Runtime to install - required: true + package(s)-to-install: + description: Space separated list of Senzing packages to install. Linux only. + default: "senzingapi-runtime" + senzingapi-version: + description: Version of Senzing API to install + default: "production-v3" runs: using: composite @@ -14,9 +17,10 @@ runs: # Install staging, production or versioned release. - env: + PACKAGES_TO_INSTALL: ${{ inputs.package(s)-to-install }} SENZING_ACCEPT_EULA: I_ACCEPT_THE_SENZING_EULA - SENZING_INSTALL_VERSION: ${{ inputs.senzingapi-runtime-version }} - name: Install Senzing API Runtime + SENZING_INSTALL_VERSION: ${{ inputs.senzingapi-version }} + name: Install Senzing API shell: bash run: ${{ github.action_path }}/install-senzing.sh diff --git a/linux/install-senzing.sh b/linux/install-senzing.sh index bf46ba9..5f81777 100755 --- a/linux/install-senzing.sh +++ b/linux/install-senzing.sh @@ -11,12 +11,14 @@ set -e configure-vars() { # senzing apt repository packages + PROD_REPO=https://senzing-production-apt.s3.amazonaws.com + STAGING_REPO=https://senzing-staging-apt.s3.amazonaws.com # v3 and lower - PROD_REPO_V3_AND_LOWER=https://senzing-production-apt.s3.amazonaws.com/senzingrepo_1.0.1-1_all.deb - STAGING_REPO_V3_AND_LOWER=https://senzing-staging-apt.s3.amazonaws.com/senzingstagingrepo_1.0.1-1_all.deb + PROD_REPO_V3_AND_LOWER="$PROD_REPO/senzingrepo_1.0.1-1_all.deb" + STAGING_REPO_V3_AND_LOWER="$STAGING_REPO/senzingstagingrepo_1.0.1-1_all.deb" # v4 and above - PROD_REPO_V4_AND_ABOVE=https://senzing-production-apt.s3.amazonaws.com/senzingrepo_2.0.0-1_all.deb - STAGING_REPO_V4_AND_ABOVE=https://senzing-staging-apt.s3.amazonaws.com/senzingstagingrepo_2.0.0-1_all.deb + PROD_REPO_V4_AND_ABOVE="$PROD_REPO/senzingrepo_2.0.0-1_all.deb" + STAGING_REPO_V4_AND_ABOVE="$STAGING_REPO/senzingstagingrepo_2.0.0-1_all.deb" # semantic versions REGEX_SEM_VER="^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$" @@ -25,36 +27,46 @@ configure-vars() { if [[ $SENZING_INSTALL_VERSION =~ "production" ]]; then - echo "[INFO] install senzingapi-runtime from production" + echo "[INFO] install $PACKAGES_TO_INSTALL from production" get-generic-major-version is-major-version-greater-than-3 && INSTALL_REPO="$PROD_REPO_V4_AND_ABOVE" || INSTALL_REPO="$PROD_REPO_V3_AND_LOWER" - SENZING_PACKAGE="senzingapi-runtime" + SENZING_PACKAGES="$PACKAGES_TO_INSTALL" restrict-major-version elif [[ $SENZING_INSTALL_VERSION =~ "staging" ]]; then - echo "[INFO] install senzingapi-runtime from staging" + echo "[INFO] install $PACKAGES_TO_INSTALL from staging" get-generic-major-version is-major-version-greater-than-3 && INSTALL_REPO="$STAGING_REPO_V4_AND_ABOVE" || INSTALL_REPO="$STAGING_REPO_V3_AND_LOWER" - SENZING_PACKAGE="senzingapi-runtime" + SENZING_PACKAGES="$PACKAGES_TO_INSTALL" restrict-major-version elif [[ $SENZING_INSTALL_VERSION =~ $REGEX_SEM_VER ]]; then - echo "[INFO] install senzingapi-runtime semantic version" + echo "[INFO] install $PACKAGES_TO_INSTALL semantic version" get-semantic-major-version is-major-version-greater-than-3 && INSTALL_REPO="$PROD_REPO_V4_AND_ABOVE" || INSTALL_REPO="$PROD_REPO_V3_AND_LOWER" - SENZING_PACKAGE="senzingapi-runtime=$SENZING_INSTALL_VERSION*" + packages=($PACKAGES_TO_INSTALL) + for package in "${packages[@]}" + do + updated_packages+="$package=$SENZING_INSTALL_VERSION* " + done + SENZING_PACKAGES="$updated_packages" elif [[ $SENZING_INSTALL_VERSION =~ $REGEX_SEM_VER_BUILD_NUM ]]; then - echo "[INFO] install senzingapi-runtime semantic version with build number" + echo "[INFO] install $PACKAGES_TO_INSTALL semantic version with build number" get-semantic-major-version is-major-version-greater-than-3 && INSTALL_REPO="$PROD_REPO_V4_AND_ABOVE" || INSTALL_REPO="$PROD_REPO_V3_AND_LOWER" - SENZING_PACKAGE="senzingapi-runtime=$SENZING_INSTALL_VERSION" + packages=($PACKAGES_TO_INSTALL) + for package in "${packages[@]}" + do + updated_packages+="$package=$SENZING_INSTALL_VERSION " + done + SENZING_PACKAGES="$updated_packages" else - echo "[ERROR] senzingapi-runtime install version $SENZING_INSTALL_VERSION is unsupported" + echo "[ERROR] $PACKAGES_TO_INSTALL install version $SENZING_INSTALL_VERSION is unsupported" exit 1 fi @@ -148,13 +160,13 @@ install-senzing-repository() { ############################################ # install-senzingapi # GLOBALS: -# SENZING_PACKAGE +# SENZING_PACKAGES # full package name used for install ############################################ install-senzingapi-runtime() { - echo "[INFO] sudo --preserve-env apt-get -y install $SENZING_PACKAGE" - sudo --preserve-env apt-get -y install "$SENZING_PACKAGE" + echo "[INFO] sudo --preserve-env apt-get -y install $SENZING_PACKAGES" + sudo --preserve-env apt-get -y install "$SENZING_PACKAGES" }