<Native> Generate OH SDK Cache #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: <Native> Generate OH SDK Cache | |
on: | |
workflow_dispatch: | |
jobs: | |
generate_oh_sdk_cache: | |
name: "Generate OH SDK cache" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-java@v4 | |
id: setup-jdk | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- 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 }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 14 | |
cache: 'npm' | |
- 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 |