Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to install Beta SDKs #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,29 @@ on:
- main

jobs:
download_urls:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
sdk:
- version: '4.0'
stage: 'Release'
- version: '4.1'
stage: 'Release'
- version: '5.0'
stage: 'Beta1'
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup SDK
id: initial-setup
uses: ./
with:
cache: false
version: ${{ matrix.sdk.version }}
stage: ${{ matrix.sdk.stage }}
build:
strategy:
matrix:
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ inputs:
description: 'OpenHarmony SDK release version'
required: false
default: '4.1'
stage:
description: 'SDK stage, e.g. `Release` or `Beta1`'
required: false
default: 'Release'
cache:
description: "Whether to cache the SDK or not"
required: false
Expand Down Expand Up @@ -58,6 +62,7 @@ runs:
if: ${{ inputs.cache != 'true' || steps.cache.outputs.cache-hit != 'true' }}
env:
INPUT_VERSION: "${{ inputs.version }}"
INPUT_STAGE: "${{ inputs.stage }}"
INPUT_COMPONENTS: "${{ inputs.components }}"
INPUT_FIXUP_PATH: ${{ inputs.fixup-path }}
- name: Set Outputs
Expand Down
13 changes: 7 additions & 6 deletions install_ohos_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -eu

: "${INPUT_VERSION:?INPUT_VERSION needs to be set}"
: "${INPUT_STAGE:?INPUT_STAGE needs to be set}"

# https://repo.huaweicloud.com/openharmony/os/4.0-Release/ohos-sdk-windows_linux-public.tar.gz

Expand All @@ -25,7 +26,7 @@ else
echo "Unknown OS type. The OHOS SDK is only available for Windows, Linux and macOS."
fi

DOWNLOAD_URL="${URL_BASE}/${INPUT_VERSION}-Release/${OS_FILENAME}"
DOWNLOAD_URL="${URL_BASE}/${INPUT_VERSION}-${INPUT_STAGE}/${OS_FILENAME}"

echo "Downloading OHOS SDK from ${DOWNLOAD_URL}"

Expand All @@ -50,14 +51,14 @@ else
fi

IFS=";" read -ra COMPONENTS <<< "${INPUT_COMPONENTS}"
for COMPONENT in ${COMPONENTS[@]}
for COMPONENT in "${COMPONENTS[@]}"
do
echo "Extracting component ${COMPONENT}"
unzip ${COMPONENT}-*.zip
API_VERSION=$(cat ${COMPONENT}/oh-uni-package.json | jq -r '.apiVersion')
unzip "${COMPONENT}"-*.zip
API_VERSION=$(cat "${COMPONENT}/oh-uni-package.json" | jq -r '.apiVersion')
if [ "$INPUT_FIXUP_PATH" = "true" ]; then
mkdir -p ${API_VERSION}
mv ${COMPONENT} "${API_VERSION}/"
mkdir -p "${API_VERSION}"
mv "${COMPONENT}" "${API_VERSION}/"
fi
done
rm ./*.zip
Loading