From 52c23df12d656b054099f5fbdd02fbb28567c892 Mon Sep 17 00:00:00 2001 From: social4hyq Date: Thu, 25 Jun 2026 17:38:06 +0800 Subject: [PATCH 1/4] feat(oxide): add OpenHarmony (aarch64-unknown-linux-ohos) support - Add aarch64-unknown-linux-ohos to napi targets in crates/node/package.json - Add @tailwindcss/oxide-openharmony-arm64 optional dependency - Add crates/node/npm/openharmony-arm64/package.json platform subpackage - Add build-ohos CI job using Boshen/setup-ohos-sdk - Wire build-ohos into release job needs + Move artifacts step NAPI-RS 3.7.0 natively maps aarch64-unknown-linux-ohos to process.platform 'openharmony' with package suffix 'openharmony-arm64', so index.js is generated correctly without manual edits. Verified: built and runtime-tested on HarmonyOS HongMeng Kernel 1.12.0 (aarch64). --- .github/workflows/release.yml | 57 +++++++++++++++++++ .../node/npm/openharmony-arm64/package.json | 27 +++++++++ crates/node/package.json | 2 + 3 files changed, 86 insertions(+) create mode 100644 crates/node/npm/openharmony-arm64/package.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 19d7a9f466d9..1abf6f6e7a0f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -199,6 +199,61 @@ jobs: name: bindings-x86_64-unknown-freebsd path: ${{ env.OXIDE_LOCATION }}/*.node + build-ohos: + name: Build aarch64-unknown-linux-ohos (oxide) + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false + - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6 + with: + version: ${{ env.PNPM_VERSION }} + + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + with: + node-version: ${{ env.NODE_VERSION }} + package-manager-cache: false + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup rust target + run: rustup target add aarch64-unknown-linux-ohos + + - name: Setup OpenHarmony SDK + uses: Boshen/setup-ohos-sdk@edb865a89a712f1f15dbad932dfa9cfce849d95c # v1.0.0 + + - name: Configure OHOS linker + run: | + echo "${OHOS_SDK_NATIVE}/llvm/bin" >> $GITHUB_PATH + cat > /tmp/aarch64-linux-ohos-clang <<'WRAPPER' + #!/bin/sh + exec ${OHOS_SDK_NATIVE}/llvm/bin/clang --target=aarch64-linux-ohos "$@" + WRAPPER + chmod +x /tmp/aarch64-linux-ohos-clang + + - name: Install dependencies + run: pnpm install --ignore-scripts --frozen-lockfile --filter=!./playgrounds/* + + - name: Build release + run: pnpm run --filter ${{ env.OXIDE_LOCATION }} build:platform --target=aarch64-unknown-linux-ohos + env: + RUST_TARGET: aarch64-unknown-linux-ohos + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_OHOS_LINKER: /tmp/aarch64-linux-ohos-clang + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_OHOS_RUSTFLAGS: -C link-arg=-fuse-ld=lld -C link-arg=-lm + + - name: Strip debug symbols + run: ${OHOS_SDK_NATIVE}/llvm/bin/llvm-strip ${{ env.OXIDE_LOCATION }}/*.node + + - name: Upload artifacts + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 + with: + name: bindings-aarch64-unknown-linux-ohos + path: ${{ env.OXIDE_LOCATION }}/*.node + release: runs-on: macos-14 timeout-minutes: 15 @@ -212,6 +267,7 @@ jobs: needs: - build - build-freebsd + - build-ohos steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 @@ -277,6 +333,7 @@ jobs: cp bindings-x86_64-unknown-linux-gnu/* ./npm/linux-x64-gnu/ cp bindings-x86_64-unknown-linux-musl/* ./npm/linux-x64-musl/ cp bindings-x86_64-unknown-freebsd/* ./npm/freebsd-x64/ + cp bindings-aarch64-unknown-linux-ohos/* ./npm/openharmony-arm64/ - name: 'Version based on commit: ${{ env.INSIDERS_VERSION }}' if: env.RELEASE_KIND == 'insiders' diff --git a/crates/node/npm/openharmony-arm64/package.json b/crates/node/npm/openharmony-arm64/package.json new file mode 100644 index 000000000000..a95dd18f7921 --- /dev/null +++ b/crates/node/npm/openharmony-arm64/package.json @@ -0,0 +1,27 @@ +{ + "name": "@tailwindcss/oxide-openharmony-arm64", + "version": "4.3.1", + "repository": { + "type": "git", + "url": "git+https://github.com/tailwindlabs/tailwindcss.git", + "directory": "crates/node/npm/openharmony-arm64" + }, + "os": [ + "openharmony" + ], + "cpu": [ + "arm64" + ], + "main": "tailwindcss-oxide.openharmony-arm64.node", + "files": [ + "tailwindcss-oxide.openharmony-arm64.node" + ], + "publishConfig": { + "provenance": true, + "access": "public" + }, + "license": "MIT", + "engines": { + "node": ">= 20" + } +} diff --git a/crates/node/package.json b/crates/node/package.json index d84826e51ccf..fc9f6ece0374 100644 --- a/crates/node/package.json +++ b/crates/node/package.json @@ -14,6 +14,7 @@ "targets": [ "armv7-linux-androideabi", "aarch64-linux-android", + "aarch64-unknown-linux-ohos", "aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "aarch64-unknown-linux-musl", @@ -60,6 +61,7 @@ }, "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "workspace:*", + "@tailwindcss/oxide-openharmony-arm64": "workspace:*", "@tailwindcss/oxide-darwin-arm64": "workspace:*", "@tailwindcss/oxide-darwin-x64": "workspace:*", "@tailwindcss/oxide-freebsd-x64": "workspace:*", From 351004e77ea86e63a30051c8eb8a5ecc2c58f76c Mon Sep 17 00:00:00 2001 From: social4hyq Date: Thu, 25 Jun 2026 17:42:21 +0800 Subject: [PATCH 2/4] ci: add test-ohos-build workflow for PR verification --- .github/workflows/test-ohos-build.yml | 62 +++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/test-ohos-build.yml diff --git a/.github/workflows/test-ohos-build.yml b/.github/workflows/test-ohos-build.yml new file mode 100644 index 000000000000..6bbeb640d50d --- /dev/null +++ b/.github/workflows/test-ohos-build.yml @@ -0,0 +1,62 @@ +name: Test OHOS build + +on: + push: + branches: [feat/ohos-support] + workflow_dispatch: + +env: + NODE_VERSION: 24 + PNPM_VERSION: '9.6.0' + OXIDE_LOCATION: ./crates/node + +jobs: + build-ohos: + name: Build aarch64-unknown-linux-ohos (oxide) + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + with: + version: ${{ env.PNPM_VERSION }} + + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Setup rust target + run: rustup target add aarch64-unknown-linux-ohos + + - name: Setup OpenHarmony SDK + uses: Boshen/setup-ohos-sdk@edb865a89a712f1f15dbad932dfa9cfce849d95c # v1.0.0 + + - name: Configure OHOS linker + run: | + echo "${OHOS_SDK_NATIVE}/llvm/bin" >> $GITHUB_PATH + cat > /tmp/aarch64-linux-ohos-clang <<'WRAPPER' + #!/bin/sh + exec ${OHOS_SDK_NATIVE}/llvm/bin/clang --target=aarch64-linux-ohos "$@" + WRAPPER + chmod +x /tmp/aarch64-linux-ohos-clang + + - name: Install dependencies + run: pnpm install --ignore-scripts --frozen-lockfile --filter=!./playgrounds/* + + - name: Build release + run: pnpm run --filter ${{ env.OXIDE_LOCATION }} build:platform --target=aarch64-unknown-linux-ohos + env: + RUST_TARGET: aarch64-unknown-linux-ohos + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_OHOS_LINKER: /tmp/aarch64-linux-ohos-clang + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_OHOS_RUSTFLAGS: -C link-arg=-fuse-ld=lld -C link-arg=-lm + + - name: Strip debug symbols + run: ${OHOS_SDK_NATIVE}/llvm/bin/llvm-strip ${{ env.OXIDE_LOCATION }}/*.node + + - name: List artifacts + run: ls -lh ${{ env.OXIDE_LOCATION }}/*.node From a2f8f449166d6ddf76c1301c09eccaac5a064c6c Mon Sep 17 00:00:00 2001 From: social4hyq Date: Thu, 25 Jun 2026 17:47:08 +0800 Subject: [PATCH 3/4] chore: update pnpm-lock.yaml for openharmony-arm64 workspace package --- pnpm-lock.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cafb7a4fdac0..4d8ef3c94b63 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -127,6 +127,9 @@ importers: '@tailwindcss/oxide-linux-x64-musl': specifier: workspace:* version: link:npm/linux-x64-musl + '@tailwindcss/oxide-openharmony-arm64': + specifier: workspace:* + version: link:npm/openharmony-arm64 '@tailwindcss/oxide-wasm32-wasi': specifier: workspace:* version: link:npm/wasm32-wasi @@ -167,6 +170,8 @@ importers: crates/node/npm/linux-x64-musl: {} + crates/node/npm/openharmony-arm64: {} + crates/node/npm/wasm32-wasi: dependencies: '@emnapi/core': From 73845528e9e3a42b1a7c262a7b08c7b5dd7a0370 Mon Sep 17 00:00:00 2001 From: social4hyq Date: Thu, 25 Jun 2026 17:56:46 +0800 Subject: [PATCH 4/4] fix: address PR review feedback - Pin dtolnay/rust-toolchain to commit SHA (supply-chain policy) - Remove --ignore-scripts from build-ohos install step - Add openharmony-arm64 to version-packages.mjs syncedWorkspaces so the platform package version stays in sync on every release - Remove test-ohos-build.yml (verification artifact, not for upstream) --- .github/workflows/release.yml | 4 +- .github/workflows/test-ohos-build.yml | 62 --------------------------- scripts/version-packages.mjs | 1 + 3 files changed, 3 insertions(+), 64 deletions(-) delete mode 100644 .github/workflows/test-ohos-build.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1abf6f6e7a0f..e2a22340573a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -218,7 +218,7 @@ jobs: package-manager-cache: false - name: Install Rust - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@67ef31d5b988238dd797d409d6f9574278e20537 # stable - name: Setup rust target run: rustup target add aarch64-unknown-linux-ohos @@ -236,7 +236,7 @@ jobs: chmod +x /tmp/aarch64-linux-ohos-clang - name: Install dependencies - run: pnpm install --ignore-scripts --frozen-lockfile --filter=!./playgrounds/* + run: pnpm install --frozen-lockfile --filter=!./playgrounds/* - name: Build release run: pnpm run --filter ${{ env.OXIDE_LOCATION }} build:platform --target=aarch64-unknown-linux-ohos diff --git a/.github/workflows/test-ohos-build.yml b/.github/workflows/test-ohos-build.yml deleted file mode 100644 index 6bbeb640d50d..000000000000 --- a/.github/workflows/test-ohos-build.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Test OHOS build - -on: - push: - branches: [feat/ohos-support] - workflow_dispatch: - -env: - NODE_VERSION: 24 - PNPM_VERSION: '9.6.0' - OXIDE_LOCATION: ./crates/node - -jobs: - build-ohos: - name: Build aarch64-unknown-linux-ohos (oxide) - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - - - name: Setup rust target - run: rustup target add aarch64-unknown-linux-ohos - - - name: Setup OpenHarmony SDK - uses: Boshen/setup-ohos-sdk@edb865a89a712f1f15dbad932dfa9cfce849d95c # v1.0.0 - - - name: Configure OHOS linker - run: | - echo "${OHOS_SDK_NATIVE}/llvm/bin" >> $GITHUB_PATH - cat > /tmp/aarch64-linux-ohos-clang <<'WRAPPER' - #!/bin/sh - exec ${OHOS_SDK_NATIVE}/llvm/bin/clang --target=aarch64-linux-ohos "$@" - WRAPPER - chmod +x /tmp/aarch64-linux-ohos-clang - - - name: Install dependencies - run: pnpm install --ignore-scripts --frozen-lockfile --filter=!./playgrounds/* - - - name: Build release - run: pnpm run --filter ${{ env.OXIDE_LOCATION }} build:platform --target=aarch64-unknown-linux-ohos - env: - RUST_TARGET: aarch64-unknown-linux-ohos - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_OHOS_LINKER: /tmp/aarch64-linux-ohos-clang - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_OHOS_RUSTFLAGS: -C link-arg=-fuse-ld=lld -C link-arg=-lm - - - name: Strip debug symbols - run: ${OHOS_SDK_NATIVE}/llvm/bin/llvm-strip ${{ env.OXIDE_LOCATION }}/*.node - - - name: List artifacts - run: ls -lh ${{ env.OXIDE_LOCATION }}/*.node diff --git a/scripts/version-packages.mjs b/scripts/version-packages.mjs index 1641d540476f..b73ca5ba0b28 100644 --- a/scripts/version-packages.mjs +++ b/scripts/version-packages.mjs @@ -28,6 +28,7 @@ const syncedWorkspaces = new Map([ 'crates/node/npm/linux-arm64-musl', 'crates/node/npm/linux-x64-gnu', 'crates/node/npm/linux-x64-musl', + 'crates/node/npm/openharmony-arm64', 'crates/node/npm/wasm32-wasi', 'crates/node/npm/win32-arm64-msvc', 'crates/node/npm/win32-x64-msvc',