From c77df2384dbf660b225d8c28040263ab9eda04c8 Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:38:22 -0700 Subject: [PATCH] update osx and win senzing paths to support v3 and v4 --- action.yaml | 4 +-- darwin/action.yaml | 20 ++--------- darwin/download-senzing.sh | 71 ------------------------------------- linux/install-senzing.sh | 6 ++-- windows/action.yaml | 19 ++-------- windows/download-senzing.sh | 71 ------------------------------------- 6 files changed, 10 insertions(+), 181 deletions(-) delete mode 100755 darwin/download-senzing.sh delete mode 100755 windows/download-senzing.sh diff --git a/action.yaml b/action.yaml index e52108f..4d0c7af 100644 --- a/action.yaml +++ b/action.yaml @@ -18,13 +18,13 @@ runs: - if: runner.os == 'macOS' name: Run on macOS - uses: senzing-factory/github-action-install-senzing-api/darwin@v3 + uses: senzing-factory/github-action-install-senzing-api/darwin@69-skern with: senzingapi-version: ${{ inputs.senzingapi-version }} - if: runner.os == 'Windows' name: Run on Windows - uses: senzing-factory/github-action-install-senzing-api/windows@v3 + uses: senzing-factory/github-action-install-senzing-api/windows@69-skern with: senzingapi-version: ${{ inputs.senzingapi-version }} diff --git a/darwin/action.yaml b/darwin/action.yaml index 80ffe32..4c141e3 100644 --- a/darwin/action.yaml +++ b/darwin/action.yaml @@ -11,29 +11,13 @@ runs: using: composite steps: - # Download latest staging or production image. + # Install latest staging or production image. - env: SENZING_INSTALL_VERSION: ${{ inputs.senzingapi-version }} name: Install Senzing API shell: bash - run: ${{ github.action_path }}/download-senzing.sh - - # Install Senzing API. - - - name: Install Senzing API - shell: bash - run: | - ls -tlc /tmp/ - hdiutil attach /tmp/senzingapi.dmg - sudo mkdir -p /opt/senzing/ - sudo cp -R /Volumes/SenzingAPI/senzing/er /opt/senzing - - # Verify installation. - - - name: Verify installed Senzing API version - shell: bash - run: cat /opt/senzing/er/szBuildVersion.json + run: ${{ github.action_path }}/install-senzing.sh branding: icon: download diff --git a/darwin/download-senzing.sh b/darwin/download-senzing.sh deleted file mode 100755 index 68fc9d7..0000000 --- a/darwin/download-senzing.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash -set -e - -############################################ -# configure-vars -# GLOBALS: -# SENZING_INSTALL_VERSION -# one of: production-v, staging-v -############################################ -configure-vars() { - - if [[ $SENZING_INSTALL_VERSION =~ "production" ]]; then - - echo "[INFO] install senzingapi from production" - SENZINGAPI_URI="s3://public-read-access/MacOS_API/" - SENZINGAPI_URL="https://public-read-access.s3.amazonaws.com/MacOS_API" - - elif [[ $SENZING_INSTALL_VERSION =~ "staging" ]]; then - - echo "[INFO] install senzingapi from staging" - SENZINGAPI_URI="s3://public-read-access/staging/" - SENZINGAPI_URL="https://public-read-access.s3.amazonaws.com/staging" - - else - echo "[ERROR] senzingapi install version $SENZING_INSTALL_VERSION is unsupported" - exit 1 - fi - -} - -############################################ -# determine-latest-dmg-for-major-version -# GLOBALS: -# SENZING_INSTALL_VERSION -# one of: production-v, staging-v -# SENZINGAPI_URI -############################################ -determine-latest-dmg-for-major-version() { - - major_version=$(echo "$SENZING_INSTALL_VERSION" | grep -Eo '[0-9]+$') - echo "[INFO] major version is: $major_version" - - aws s3 ls $SENZINGAPI_URI --recursive --no-sign-request | grep -o -E '[^ ]+.dmg$' > /tmp/staging-versions - latest_staging_version=$(< /tmp/staging-versions grep "_$major_version" | sort -r | head -n 1 | grep -o '/.*') - rm /tmp/staging-versions - echo "[INFO] latest staging version is: $latest_staging_version" - - SENZINGAPI_DMG_URL="$SENZINGAPI_URL$latest_staging_version" - -} - -############################################ -# download-dmg -# GLOBALS: -# SENZINGAPI_DMG_URL -############################################ -download-dmg() { - - echo "[INFO] curl --output /tmp/senzingapi.dmg $SENZINGAPI_DMG_URL" - curl --output /tmp/senzingapi.dmg "$SENZINGAPI_DMG_URL" - -} - -############################################ -# Main -############################################ - -echo "[INFO] senzing version to install is: $SENZING_INSTALL_VERSION" -configure-vars -determine-latest-dmg-for-major-version -download-dmg diff --git a/linux/install-senzing.sh b/linux/install-senzing.sh index c928e78..bcb125a 100755 --- a/linux/install-senzing.sh +++ b/linux/install-senzing.sh @@ -161,8 +161,10 @@ install-senzingapi-runtime() { ############################################ # verify-installation # GLOBALS: -# SENZING_PACKAGE -# full package name used for install +# MAJOR_VERSION +# set prior to this call via either +# get-generic-major-version or +# get-semantic-major-version ############################################ verify-installation() { diff --git a/windows/action.yaml b/windows/action.yaml index 53446c3..d142d92 100644 --- a/windows/action.yaml +++ b/windows/action.yaml @@ -12,28 +12,13 @@ runs: using: composite steps: - # Download latest staging or production image. + # Install latest staging or production image. - env: SENZING_INSTALL_VERSION: ${{ inputs.senzingapi-version }} name: Install Senzing API shell: bash - run: $GITHUB_ACTION_PATH/download-senzing.sh - - # Install Senzing API. - - - name: Install Senzing API - shell: cmd - run: | - 7z x -y -o"C:\Program Files" senzingapi.zip - ren "C:\Program Files\senzing" "senzing2" - ren "C:\Program Files\senzing2" "Senzing" - - # Verify installation. - - - name: Verify installed Senzing API version - shell: bash - run: cat "/c/Program Files\senzing\er\szBuildVersion.json" + run: $GITHUB_ACTION_PATH/install-senzing.sh branding: icon: download diff --git a/windows/download-senzing.sh b/windows/download-senzing.sh deleted file mode 100755 index f694661..0000000 --- a/windows/download-senzing.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash -set -e - -############################################ -# configure-vars -# GLOBALS: -# SENZING_INSTALL_VERSION -# one of: production-v, staging-v -############################################ -configure-vars() { - - if [[ $SENZING_INSTALL_VERSION =~ "production" ]]; then - - echo "[INFO] install senzingapi from production" - SENZINGAPI_URI="s3://public-read-access/Windows_API/" - SENZINGAPI_URL="https://public-read-access.s3.amazonaws.com/Windows_API" - - elif [[ $SENZING_INSTALL_VERSION =~ "staging" ]]; then - - echo "[INFO] install senzingapi from staging" - SENZINGAPI_URI="s3://public-read-access/staging/" - SENZINGAPI_URL="https://public-read-access.s3.amazonaws.com/staging" - - else - echo "[ERROR] senzingapi install version $SENZING_INSTALL_VERSION is unsupported" - exit 1 - fi - -} - -############################################ -# determine-latest-zip-for-major-version -# GLOBALS: -# SENZING_INSTALL_VERSION -# one of: production-v, staging-v -# SENZINGAPI_URI -############################################ -determine-latest-zip-for-major-version() { - - major_version=$(echo "$SENZING_INSTALL_VERSION" | grep -Eo '[0-9]+$') - echo "[INFO] major version is: $major_version" - - aws s3 ls $SENZINGAPI_URI --recursive --no-sign-request --region us-east-1 | grep -o -E '[^ ]+.zip$' > /tmp/staging-versions - latest_staging_version=$(< /tmp/staging-versions grep "_$major_version" | sort -r | head -n 1 | grep -o '/.*') - rm /tmp/staging-versions - echo "[INFO] latest staging version is: $latest_staging_version" - - SENZINGAPI_ZIP_URL="$SENZINGAPI_URL$latest_staging_version" - -} - -############################################ -# download-zip -# GLOBALS: -# SENZINGAPI_ZIP_URL -############################################ -download-zip() { - - echo "[INFO] curl --output senzingapi.zip $SENZINGAPI_ZIP_URL" - curl --output senzingapi.zip "$SENZINGAPI_ZIP_URL" - -} - -############################################ -# Main -############################################ - -echo "[INFO] senzing version to install is: $SENZING_INSTALL_VERSION" -configure-vars -determine-latest-zip-for-major-version -download-zip