diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 97eb5b2..5f4d8c9 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -44,7 +44,10 @@ jobs: SDK_PATH: "${{ steps.sdk-with-components.outputs.sdk-path }}" run: | ${OHOS_SDK_NATIVE}/llvm/bin/clang --version - ${SDK_PATH}/*/toolchains/hdc --version + if [[ test -d "${SDK_PATH}"/*/previewer ]]; then + echo "Unselected component should not be present" + exit 1 + fi - name: Remove previous SDK installation env: SDK_PATH: "${{ steps.sdk-with-components.outputs.sdk-path }}" diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e0715fe --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# v0.2 (unreleased) + +- Now supports OH 5.0 +- The `components` input now defaults to `all`, since `hvigor` 5 will throw an error if not all + components are installed. diff --git a/action.yml b/action.yml index 0b401d1..b58b5b3 100644 --- a/action.yml +++ b/action.yml @@ -12,7 +12,7 @@ inputs: components: description: "Semicolon separated list of SDK components that should be made available" required: false - default: 'native' + default: 'all' fixup-path: description: "Whether to fixup the output paths so that the components appear under api level directory" required: false diff --git a/install_ohos_sdk.sh b/install_ohos_sdk.sh index f5c7d75..f727179 100755 --- a/install_ohos_sdk.sh +++ b/install_ohos_sdk.sh @@ -90,12 +90,30 @@ fi OHOS_BASE_SDK_HOME="$PWD" -IFS=";" read -ra COMPONENTS <<< "${INPUT_COMPONENTS}" +if [[ "${INPUT_COMPONENTS}" == "all" ]]; then + COMPONENTS=(*.zip) +else + IFS=";" read -ra COMPONENTS <<< "${INPUT_COMPONENTS}" + resolved_components=() + for COMPONENT in "${COMPONENTS[@]}" + do + resolved_components+=("${COMPONENT}"-*.zip) + done + COMPONENTS=(${resolved_components[@]}) +fi + for COMPONENT in "${COMPONENTS[@]}" do echo "Extracting component ${COMPONENT}" echo "::group::Unzipping archive" - unzip "${COMPONENT}"-*.zip + #shellcheck disable=SC2144 + if [[ -f "${COMPONENT}" ]]; then + unzip "${COMPONENT}" + else + echo "Failed to find component ${COMPONENT}" + ls -la + exit 1 + fi echo "::endgroup::" API_VERSION=$(cat "${COMPONENT}/oh-uni-package.json" | jq -r '.apiVersion') if [ "$INPUT_FIXUP_PATH" = "true" ]; then