Skip to content

chore(ci): modify unzip command in ci workflow #3

chore(ci): modify unzip command in ci workflow

chore(ci): modify unzip command in ci workflow #3

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Get Release Assets
id: get_assets
run: |
# 获取 release 的信息
RELEASE_JSON=$(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/harmonyos-dev/hos-sdk/releases/latest)
# 从 release 的信息中提取需要的 asset URL
ASSET_URL=$(echo "$RELEASE_JSON" | jq -r '.assets[] | select(.name | test("commandline-tools-linux-2.0.0.2.zip")) | .browser_download_url')
# 输出 asset URL
echo "Asset URL: $ASSET_URL"
# 下载 release asset
curl -LJO "$ASSET_URL"
- name: Unzip Release Assets
run: |
unzip -o commandline-tools-linux-2.0.0.2.zip

Check failure on line 39 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

You have an error in your yaml syntax on line 39
- name: Install HarmonyOS SDK
run: |
# chmod +x commandline-tools-linux-
chmod +x command-line-tools/sdkmanager/bin/sdkmgr
# 安装 HarmonyOS SDK
command-line-tools/sdkmanager/bin/sdkmgr install toolchains:9 OpenHarmony/toolchains:9 --accept-license
- name: Install dependencies
run: npm ci
- name: Build
run: ./node_modules/.bin/hvigor --mode module -p product=default assembleHap
- name: Test
run: npm test