Skip to content

initial transfer of commits from Snapp-Mobile/oh-action #1

initial transfer of commits from Snapp-Mobile/oh-action

initial transfer of commits from Snapp-Mobile/oh-action #1

Workflow file for this run

name: Test oh-action with sdk-11
on:
push:
branches:
- main
pull_request:
branches:
- main
defaults:
run:
working-directory: example/open-harmony/sdk-11/Sample
jobs:
test:
runs-on: macos-latest
env:
EXAMPLE_PROJECT_PATH: example/open-harmony/sdk-11/Sample
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install tree command
run: brew install tree
- name: Setup OpenHarmony signing certificates and keystore
# This step extracts the required signing materials from a base64 encoded zip stored in GitHub Secrets
# The zip contains:
# - .cer file: Developer certificate for signing
# - .p7b file: Profile for app provisioning
# - .p12 file: Keystore containing private key
run: |
# Decode base64 secret to zip file
echo "${{ secrets.OH_SECRETS_ZIP }}" | base64 -d > secrets.zip
# Extract files while preserving directory structure
unzip -o secrets.zip
# Cleanup temporary zip file
rm secrets.zip
# Display extracted files for verification
echo "=== Extracted Signing Materials ==="
tree .secret -L 4
- name: Test oh-action
uses: ./
with:
working-directory: ${{ env.EXAMPLE_PROJECT_PATH }}
- name: Verify Installation
run: |
echo "=== Environment Variables ==="
echo "PATH: $PATH"
echo "OHOS_BASE_SDK_HOME: $OHOS_BASE_SDK_HOME"
echo "CMD_PATH: $CMD_PATH"
echo "=== OHPM Installation ==="
which ohpm
ohpm -v
echo "=== Hvigor Installation ==="
which hvigorw
hvigorw --version
echo "=== Installation Directories ==="
echo "Command-line Tools:"
tree -L 3 $CMD_PATH
echo "OpenHarmony SDK:"
tree -L 3 $OHOS_BASE_SDK_HOME
echo "=== Node.js Version ==="
node --version
npm --version
echo "=== NPM Configuration ==="
cat $HOME/.npmrc
- name: Install OpenHarmony Dependencies
run: ohpm install --all
- name: Initialize and Build
run: |
hvigorw --version --accept-license
hvigorw clean --no-parallel --no-daemon
hvigorw assembleHap --mode module -p product=default --stacktrace --no-parallel --no-daemon