Skip to content

chore(package): ship only the HDiffPatch / lzma files the builds compile #81

chore(package): ship only the HDiffPatch / lzma files the builds compile

chore(package): ship only the HDiffPatch / lzma files the builds compile #81

Workflow file for this run

name: harmony-build
# Compiles the HarmonyOS HAR on pull requests that touch its inputs, in the
# same pinned container publish.yml uses. Until this job existed the HAR was
# only compiled at release time, so an ArkTS type error, a broken NAPI export
# or a stale C++ method table (docs/NATIVE_CHECK_FOLLOWUPS.md, 2026-08-13) was
# first seen when publishing. assembleHar runs the ArkTS compiler over the
# .ets/.ts sources, which is the real type check; check-harmony-types.js
# adds a strict tsc pass over the .ts sources and must not skip here.
#
# The JS <-> native method parity and constant-mirror checks run in
# `bun lint` (lint.yml) on every PR, so they are not repeated here.
on:
pull_request:
branches:
- master
paths: &harmony-paths
- '.github/workflows/harmony-build.yml'
- '.gitmodules'
- 'package.json'
- 'bun.lock'
- 'harmony/**'
- 'cpp/**'
- 'android/jni/**'
- 'scripts/build-harmony-har.js'
- 'scripts/check-harmony-types.js'
push:
branches:
- master
paths: *harmony-paths
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
harmony-build:
runs-on: ubuntu-latest
# Keep the digest in sync with publish.yml; bump both deliberately.
container: ghcr.io/sanchuanhehe/harmony-next-pipeline-docker/harmonyos-ci-image:latest@sha256:2836142b7b6ae8837ad0e36cacc650f00e8c88f55b4e9f34be66cc98a731c5da
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
- name: Configure git safe.directory
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git submodule foreach --recursive 'git config --global --add safe.directory "$toplevel/$sm_path"'
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.0
# The container ships no node; the check scripts and build-harmony-har
# (npm run) need one, exactly as publish.yml sets it up.
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- run: bun install --frozen-lockfile
- name: Build Harmony HAR (release)
run: npm run build:harmony-har -- --build-mode release
- name: Verify Harmony HAR artifact
run: test -f harmony/pushy.har
- name: Verify the HAR native library carries no update wording
shell: bash
run: |
dir="$(mktemp -d)"
tar -xzf harmony/pushy.har -C "$dir"
mapfile -d '' -t libs < <(find "$dir" -path '*/libs/*' -name 'librnpushy.so' -print0)
test "${#libs[@]}" -gt 0
node scripts/check-binary-strings.js "${libs[@]}"
# Required: the script also searches the container's install roots for
# the OpenHarmony SDK declarations and fails if it finds none.
- name: Type-check Harmony TS sources (required)
run: node scripts/check-harmony-types.js
env:
HARMONY_TYPECHECK_REQUIRED: '1'