Skip to content

<Native> Generate OH SDK Cache #15

<Native> Generate OH SDK Cache

<Native> Generate OH SDK Cache #15

name: <Native> Generate OH SDK Cache
on:
workflow_dispatch:
jobs:
generate_oh_sdk_cache:
name: "Generate OH SDK cache"
runs-on: ubuntu-latest
steps:
- name: Get oh sdk cache directory path
id: oh-sdk-cache-dir-path
run: |
echo "cache dir: "
echo "dir=$HOME/openharmony" >> $GITHUB_OUTPUT
- name: Output cache dir
run: |
echo "Output cache dir: ${{ steps.oh-sdk-cache-dir-path.outputs.dir }}"
- name: Cache OH SDK
id: cache-oh-sdk
uses: actions/cache@v4
env:
cache-name: cache-oh-sdk-12
with:
path: ${{ steps.oh-sdk-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-build-${{ env.cache-name }}
- if: ${{ steps.cache-oh-sdk.outputs.cache-hit != 'true' }}
name: No Cache found, install oh sdk
continue-on-error: false
run: |
if [ ! -d "$HOME/openharmony" ]; then
mkdir -p $HOME/openharmony
echo "Download commandline-tools-linux.zip ..."
wget -q https://github.com/dumganhar/oh-sdk-for-ci/releases/download/api-12/commandline-tools-linux-x64-5.0.3.906.zip.001
wget -q https://github.com/dumganhar/oh-sdk-for-ci/releases/download/api-12/commandline-tools-linux-x64-5.0.3.906.zip.002
echo "Unzip commandline-tools-linux.zip ..."
7z x commandline-tools-linux-x64-5.0.3.906.zip.001 -o$HOME/openharmony > /dev/null
cd $HOME/openharmony
ls -l
cd commandline-tools-linux-x64-5.0.3.906
ls -l
fi