diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 66a9873..1a35081 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -112,14 +112,16 @@ jobs: INSTALL_PATH: 'install-directory' SONAR_HOST_URL: 'http://sonar-host.com' SONAR_SCANNER_VERSION: 'vX.Y.Z.MMMM' - SONAR_SCANNER_URL_WINDOWS: 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-windows.zip' - SONAR_SCANNER_SHA_WINDOWS: 'DOWNLOAD-SHA-WINDOWS' - SONAR_SCANNER_URL_LINUX: 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-linux.zip' - SONAR_SCANNER_SHA_LINUX: 'DOWNLOAD-SHA-LINUX' - SONAR_SCANNER_URL_MACOSX: 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-macosx.zip' - SONAR_SCANNER_SHA_MACOSX: 'DOWNLOAD-SHA-MACOSX' - SONAR_SCANNER_URL_UNIVERSAL: 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM.zip' - SONAR_SCANNER_SHA_UNIVERSAL: 'DOWNLOAD-SHA' + SONAR_SCANNER_URL_WINDOWS_X64: 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-windows-x64.zip' + SONAR_SCANNER_SHA_WINDOWS_X64: 'DOWNLOAD-SHA-WINDOWS-X64' + SONAR_SCANNER_URL_LINUX_X64: 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-linux-x64.zip' + SONAR_SCANNER_SHA_LINUX_X64: 'DOWNLOAD-SHA-LINUX-X64' + SONAR_SCANNER_URL_LINUX_AARCH64: 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-linux-aarch64.zip' + SONAR_SCANNER_SHA_LINUX_AARCH64: 'DOWNLOAD-SHA-LINUX-AARCH64' + SONAR_SCANNER_URL_MACOS-X64: 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-macos-x64.zip' + SONAR_SCANNER_SHA_MACOS-X64: 'DOWNLOAD-SHA-MACOSX-X64' + SONAR_SCANNER_URL_MACOS-AARCH64: 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-macos-aarch64.zip' + SONAR_SCANNER_SHA_MACOS-AARCH64: 'DOWNLOAD-SHA-MACOSX-AARCH64' steps: - uses: actions/checkout@v3 with: @@ -155,10 +157,10 @@ jobs: grep -v "::error::" output echo "- Check sonar-scanner:" - grep "sonar-scanner-url=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-linux.zip" output - grep "sonar-scanner-sha=DOWNLOAD-SHA-LINUX" output - grep "sonar-scanner-dir=install-directory/sonar-scanner-vX.Y.Z.MMMM-linux" output - grep "sonar-scanner-bin=install-directory/sonar-scanner-vX.Y.Z.MMMM-linux/bin/sonar-scanner" output + grep "sonar-scanner-url=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-linux-x64.zip" output + grep "sonar-scanner-sha=DOWNLOAD-SHA-LINUX-X64" output + grep "sonar-scanner-dir=install-directory/sonar-scanner-vX.Y.Z.MMMM-linux-x64" output + grep "sonar-scanner-bin=install-directory/sonar-scanner-vX.Y.Z.MMMM-linux-x64/bin/sonar-scanner" output echo "- Check build-wrapper:" grep "build-wrapper-url=http://sonar-host.com/static/cpp/build-wrapper-linux-x86.zip" output @@ -175,10 +177,10 @@ jobs: grep -v "::error::" output echo "- Check sonar-scanner:" - grep "sonar-scanner-url=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM.zip" output - grep "sonar-scanner-sha=DOWNLOAD-SHA" output - grep "sonar-scanner-dir=install-directory/sonar-scanner-vX.Y.Z.MMMM" output - grep "sonar-scanner-bin=install-directory/sonar-scanner-vX.Y.Z.MMMM/bin/sonar-scanner" output + grep "sonar-scanner-url=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-linux-aarch64.zip" output + grep "sonar-scanner-sha=DOWNLOAD-SHA-AARCH64" output + grep "sonar-scanner-dir=install-directory/sonar-scanner-vX.Y.Z.MMMM-linux-aarch64" output + grep "sonar-scanner-bin=install-directory/sonar-scanner-vX.Y.Z.MMMM-linux-aarch64/bin/sonar-scanner" output echo "- Check build-wrapper:" grep "build-wrapper-url=http://sonar-host.com/static/cpp/build-wrapper-linux-aarch64.zip" output @@ -195,8 +197,8 @@ jobs: grep -v "::error::" output echo "- Check sonar-scanner:" - grep "sonar-scanner-url=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-macosx.zip" output - grep "sonar-scanner-sha=DOWNLOAD-SHA-MACOSX" output + grep "sonar-scanner-url=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-macosx-x64.zip" output + grep "sonar-scanner-sha=DOWNLOAD-SHA-MACOS-X64" output grep "sonar-scanner-dir=install-directory/sonar-scanner-vX.Y.Z.MMMM-macosx" output grep "sonar-scanner-bin=install-directory/sonar-scanner-vX.Y.Z.MMMM-macosx/bin/sonar-scanner" output @@ -215,10 +217,10 @@ jobs: grep -v "::error::" output echo "- Check sonar-scanner:" - grep "sonar-scanner-url=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-macosx.zip" output - grep "sonar-scanner-sha=DOWNLOAD-SHA-MACOSX" output - grep "sonar-scanner-dir=install-directory/sonar-scanner-vX.Y.Z.MMMM-macosx" output - grep "sonar-scanner-bin=install-directory/sonar-scanner-vX.Y.Z.MMMM-macosx/bin/sonar-scanner" output + grep "sonar-scanner-url=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-macosx-aarch64.zip" output + grep "sonar-scanner-sha=DOWNLOAD-SHA-MACOSX-AARCH64" output + grep "sonar-scanner-dir=install-directory/sonar-scanner-vX.Y.Z.MMMM-macosx-aarch64" output + grep "sonar-scanner-bin=install-directory/sonar-scanner-vX.Y.Z.MMMM-macosx-aarch64/bin/sonar-scanner" output echo "- Check build-wrapper:" grep "build-wrapper-url=http://sonar-host.com/static/cpp/build-wrapper-macosx-x86.zip" output diff --git a/action.yml b/action.yml index d07ce6e..92f0c92 100644 --- a/action.yml +++ b/action.yml @@ -58,14 +58,16 @@ runs: INSTALL_PATH: ${{ inputs.installation-path }} SONAR_HOST_URL: 'https://sonarcloud.io' SONAR_SCANNER_VERSION: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-version }} - SONAR_SCANNER_URL_WINDOWS: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-url-windows }} - SONAR_SCANNER_SHA_WINDOWS: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-sha-windows }} - SONAR_SCANNER_URL_LINUX: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-url-linux }} - SONAR_SCANNER_SHA_LINUX: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-sha-linux }} - SONAR_SCANNER_URL_MACOSX: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-url-macosx }} - SONAR_SCANNER_SHA_MACOSX: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-sha-macosx }} - SONAR_SCANNER_URL_UNIVERSAL: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-url-universal }} - SONAR_SCANNER_SHA_UNIVERSAL: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-sha-universal }} + SONAR_SCANNER_URL_WINDOWS_X64: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-url-windows-x64 }} + SONAR_SCANNER_SHA_WINDOWS_X64: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-sha-windows-x64 }} + SONAR_SCANNER_URL_LINUX_X64: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-url-linux-x64 }} + SONAR_SCANNER_SHA_LINUX_X64: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-sha-linux-x64 }} + SONAR_SCANNER_URL_LINUX_AARCH64: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-url-linux-x64 }} + SONAR_SCANNER_SHA_LINUX_AARCH64: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-sha-linux-x64 }} + SONAR_SCANNER_URL_MACOS_X64: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-url-macosx-x64 }} + SONAR_SCANNER_SHA_MACOS_X64: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-sha-macosx-x64 }} + SONAR_SCANNER_URL_MACOS_AARCH64: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-url-macosx-aarch64 }} + SONAR_SCANNER_SHA_MACOS_AARCH64: ${{ steps.sonar-scanner-version.outputs.sonar-scanner-sha-macosx-aarch64 }} run: ${GITHUB_ACTION_PATH}/scripts/configure_paths.sh >> $GITHUB_OUTPUT - name: Cache sonar-scanner installation diff --git a/scripts/configure_paths.sh b/scripts/configure_paths.sh index 83d0be4..3e78f3e 100755 --- a/scripts/configure_paths.sh +++ b/scripts/configure_paths.sh @@ -7,39 +7,43 @@ fi case ${OS} in Windows) - SONAR_SCANNER_SUFFIX="-windows" BUILD_WRAPPER_SUFFIX="win-x86" SONAR_SCANNER_NAME="sonar-scanner.bat" BUILD_WRAPPER_NAME="build-wrapper-win-x86-64.exe" - SONAR_SCANNER_URL="${SONAR_SCANNER_URL_WINDOWS}" - SONAR_SCANNER_SHA="${SONAR_SCANNER_SHA_WINDOWS}" + SONAR_SCANNER_URL="${SONAR_SCANNER_URL_WINDOWS_X64}" + SONAR_SCANNER_SHA="${SONAR_SCANNER_SHA_WINDOWS_X64}" ;; Linux) case ${ARCH} in X64) - SONAR_SCANNER_SUFFIX="-linux" BUILD_WRAPPER_SUFFIX="linux-x86" BUILD_WRAPPER_NAME="build-wrapper-linux-x86-64" - SONAR_SCANNER_URL="${SONAR_SCANNER_URL_LINUX}" - SONAR_SCANNER_SHA="${SONAR_SCANNER_SHA_LINUX}" + SONAR_SCANNER_URL="${SONAR_SCANNER_URL_LINUX_X64}" + SONAR_SCANNER_SHA="${SONAR_SCANNER_SHA_LINUX_X64}" ;; ARM64) - SONAR_SCANNER_SUFFIX="" BUILD_WRAPPER_SUFFIX="linux-aarch64" BUILD_WRAPPER_NAME="build-wrapper-linux-aarch64" - SONAR_SCANNER_URL="${SONAR_SCANNER_URL_UNIVERSAL}" - SONAR_SCANNER_SHA="${SONAR_SCANNER_SHA_UNIVERSAL}" + SONAR_SCANNER_URL="${SONAR_SCANNER_URL_AARCH64}" + SONAR_SCANNER_SHA="${SONAR_SCANNER_SHA_AARCH64}" ;; esac SONAR_SCANNER_NAME="sonar-scanner" ;; macOS) - SONAR_SCANNER_SUFFIX="-macosx" + case ${ARCH} in + X64) + SONAR_SCANNER_URL=$SONAR_SCANNER_URL_MACOS_X64 + SONAR_SCANNER_SHA=$SONAR_SCANNER_SHA_MACOS_X64 + ;; + ARM64) + SONAR_SCANNER_URL=$SONAR_SCANNER_URL_MACOS_AARCH64 + SONAR_SCANNER_SHA=$SONAR_SCANNER_SHA_MACOS_AARCH64 + ;; + esac BUILD_WRAPPER_SUFFIX="macosx-x86" SONAR_SCANNER_NAME="sonar-scanner" BUILD_WRAPPER_NAME="build-wrapper-macosx-x86" - SONAR_SCANNER_URL="${SONAR_SCANNER_URL_MACOSX}" - SONAR_SCANNER_SHA="${SONAR_SCANNER_SHA_MACOSX}" ;; *) echo "::error::Unsupported runner OS '${OS}'" @@ -47,11 +51,13 @@ case ${OS} in ;; esac +SONAR_SCANNER_SUFFIX="${OS}-${ARCH}" + echo "sonar-scanner-url=${SONAR_SCANNER_URL}" echo "sonar-scanner-sha=${SONAR_SCANNER_SHA}" -SONAR_SCANNER_DIR="${INSTALL_PATH}/sonar-scanner-${SONAR_SCANNER_VERSION}${SONAR_SCANNER_SUFFIX}" +SONAR_SCANNER_DIR="${INSTALL_PATH}/sonar-scanner-${SONAR_SCANNER_VERSION}-${SONAR_SCANNER_SUFFIX}" echo "sonar-scanner-dir=${SONAR_SCANNER_DIR}" echo "sonar-scanner-bin=${SONAR_SCANNER_DIR}/bin/${SONAR_SCANNER_NAME}" diff --git a/scripts/fetch_latest_version.sh b/scripts/fetch_latest_version.sh index fa34973..774b035 100755 --- a/scripts/fetch_latest_version.sh +++ b/scripts/fetch_latest_version.sh @@ -8,15 +8,18 @@ check_status "Failed to fetch latest sonar-scanner version from GitHub API" echo "sonar-scanner-version=${SONAR_SCANNER_VERSION}" -for OS in windows linux macosx universal; do - if [[ ${OS} == "universal" ]]; then - SONAR_SCANNER_URL="https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip" +for OS in windows linux macosx; do + if [[ "$OS" == "windows" ]]; then + ARCHS=("x64") else - SONAR_SCANNER_URL="https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-${OS}.zip" + ARCHS=("x64" "aarch64") fi - SONAR_SCANNER_SHA=$(curl -sSL "${SONAR_SCANNER_URL}.sha256") - check_status "Failed to download ${OS} sonar-scanner checksum from '${SONAR_SCANNER_URL}'" + for ARCH in "${ARCHS[@]}"; do + SONAR_SCANNER_URL="https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-${OS}-${ARCH}.zip" + SONAR_SCANNER_SHA=$(curl -sSL "${SONAR_SCANNER_URL}.sha256") + check_status "Failed to download ${OS} ${ARCH} sonar-scanner checksum from '${SONAR_SCANNER_URL}'" - echo "sonar-scanner-url-${OS}=${SONAR_SCANNER_URL}" - echo "sonar-scanner-sha-${OS}=${SONAR_SCANNER_SHA}" + echo "sonar-scanner-url-${OS}-${ARCH}=${SONAR_SCANNER_URL}" + echo "sonar-scanner-sha-${OS}-${ARCH}=${SONAR_SCANNER_SHA}" + done done diff --git a/sonar-scanner-version b/sonar-scanner-version index d8ce38d..ac27d38 100644 --- a/sonar-scanner-version +++ b/sonar-scanner-version @@ -1,9 +1,11 @@ -sonar-scanner-version=6.0.0.4432 -sonar-scanner-url-windows=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-windows.zip -sonar-scanner-sha-windows=4773dbafd2ce335c0ccaefd3606742bf59658987b5e3c6aa99e51d7ef57a8f33 -sonar-scanner-url-linux=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-linux.zip -sonar-scanner-sha-linux=f4c08ec679eeae34a7a1a5df87ee546c287f4683d1dd86afa0aae50e808e0002 -sonar-scanner-url-macosx=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-macosx.zip -sonar-scanner-sha-macosx=1a492fe70cbb5587ee90344c03a3d18f259dfc9d00a9e1bef946277e89148987 -sonar-scanner-url-universal=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432.zip -sonar-scanner-sha-universal=965a18c438a213aa2167b51c793116987bc2a9df9ad245c8e02d3ab3e54022e7 +sonar-scanner-version=6.1.0.4477 +sonar-scanner-url-windows-x64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-windows-x64.zip +sonar-scanner-sha-windows-x64=1c518fdefd1e6507475f92a0afec3720ceac9a79756773a14b461737dea0ab0f +sonar-scanner-url-linux-x64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-linux-x64.zip +sonar-scanner-sha-linux-x64=aa985eacaa4155a064647370b62fc82d1b0e06caf1d493e04c2389dd5ac74fcb +sonar-scanner-url-linux-aarch64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-linux-aarch64.zip +sonar-scanner-sha-linux-aarch64=a8d4af9776988e096e0d6bddad02d879e6c8c2cdc0c4c1c05e04208cca8d5a05 +sonar-scanner-url-macosx-x64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-macosx-x64.zip +sonar-scanner-sha-macosx-x64=7bb3516c8176ec7be43982e0cb78c1ce462741ad9ce092037e12b2fc8411eb85 +sonar-scanner-url-macosx-aarch64=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-macosx-aarch64.zip +sonar-scanner-sha-macosx-aarch64=7c7e69b6cf54e3a5ff67a08199d557e896f51bcc9b2f8f5f238a5aa359653659