Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 63 additions & 8 deletions .github/workflows/native-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,43 @@ concurrency:
cancel-in-progress: true

jobs:
native-overlay-package:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "24.x"
- name: Validate native overlay package
run: |
corepack enable
yarn install --immutable
yarn workspace @onekeyfe/react-native-native-overlay typecheck
yarn workspace @onekeyfe/react-native-native-overlay lint
yarn workspace @onekeyfe/react-native-native-overlay test --runInBand
yarn workspace @onekeyfe/react-native-native-overlay prepare
yarn workspace @onekeyfe/react-native-native-overlay pack --out "$RUNNER_TEMP/native-overlay.tgz"
mkdir "$RUNNER_TEMP/native-overlay"
tar -xzf "$RUNNER_TEMP/native-overlay.tgz" -C "$RUNNER_TEMP/native-overlay"
test -f "$RUNNER_TEMP/native-overlay/package/lib/module/index.js"
test -f "$RUNNER_TEMP/native-overlay/package/lib/typescript/src/index.d.ts"
test -f "$RUNNER_TEMP/native-overlay/package/common/cpp/react/renderer/components/RNCNativeOverlay/NativeOverlayShadowNode.cpp"
test -f "$RUNNER_TEMP/native-overlay/package/android/src/main/jni/CMakeLists.txt"
test -f "$RUNNER_TEMP/native-overlay/package/ios/RCTNativeOverlayComponentView.mm"

android-unit:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '24.x'
node-version: "24.x"
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
java-version: "17"
- uses: gradle/actions/setup-gradle@v4
- name: Install and generate native bindings
run: |
Expand All @@ -33,7 +58,7 @@ jobs:
# shellcheck disable=SC2016
find native-modules native-views -mindepth 2 -maxdepth 2 -name nitro.json -print0 |
xargs -0 -n1 -P4 bash -c 'cd "$(dirname "$0")" && yarn nitrogen > /dev/null'
- name: Run nine Android unit test suites
- name: Run ten Android unit test suites
working-directory: example/react-native/android
run: |
./gradlew --continue --no-daemon --max-workers=2 --console=plain \
Expand All @@ -45,6 +70,7 @@ jobs:
:onekeyfe_react-native-auto-size-input:testDebugUnitTest \
:onekeyfe_react-native-image:testDebugUnitTest \
:onekeyfe_react-native-native-list:testDebugUnitTest \
:onekeyfe_react-native-native-overlay:testDebugUnitTest \
:onekeyfe_react-native-text-input:testDebugUnitTest
- name: Verify every Android suite executed tests
if: always()
Expand All @@ -62,6 +88,7 @@ jobs:
'native-views/react-native-auto-size-input',
'native-views/react-native-image',
'native-views/react-native-native-list',
'native-views/react-native-native-overlay',
'native-views/react-native-text-input',
}
total = 0
Expand Down Expand Up @@ -93,7 +120,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
java-version: "17"
- name: Install verified Kotlin 2.3.21 compiler
run: |
curl -fsSLo kotlin-compiler.zip https://github.com/JetBrains/kotlin/releases/download/v2.3.21/kotlin-compiler-2.3.21.zip
Expand Down Expand Up @@ -156,11 +183,11 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '24.x'
node-version: "24.x"
- uses: ruby/setup-ruby@v1
with:
working-directory: example/react-native
ruby-version: '3.4.4'
ruby-version: "3.4.4"
bundler-cache: true
- name: Select and verify Xcode and simulator
run: |
Expand Down Expand Up @@ -204,11 +231,37 @@ jobs:
['git', 'show', 'HEAD:example/react-native/ios/Podfile.lock'], &:read
)
installed = File.read('Podfile.lock')
unless normalized_lockfile(committed) == normalized_lockfile(installed)
expected = normalized_lockfile(committed)
actual = normalized_lockfile(installed)
unless expected == actual
(expected.keys | actual.keys).sort.each do |section|
next if expected[section] == actual[section]
warn "Changed lockfile section: #{section}"
if expected[section].is_a?(Hash) && actual[section].is_a?(Hash)
(expected[section].keys | actual[section].keys).sort.each do |name|
next if expected[section][name] == actual[section][name]
warn " #{name}: #{expected[section][name].inspect} -> #{actual[section][name].inspect}"
end
else
warn " expected: #{expected[section].inspect}"
warn " installed: #{actual[section].inspect}"
end
end
abort 'CocoaPods changed the locked dependencies or checksums'
end
puts 'Podfile.lock matches: only the Hermes checksum and Specs CDN URL may differ'
RUBY
- name: Compile native overlay pod on iOS Simulator
shell: bash
run: |
set -euo pipefail
mkdir -p artifacts/ios
xcodebuild build -workspace example/react-native/ios/example.xcworkspace \
-scheme NativeOverlay -destination 'generic/platform=iOS Simulator' \
-derivedDataPath "$RUNNER_TEMP/native-tests-derived-data" \
-jobs 2 CODE_SIGNING_ALLOWED=NO IPHONEOS_DEPLOYMENT_TARGET=16.4 \
'OTHER_LDFLAGS=$(inherited) -lc++' \
2>&1 | tee artifacts/ios/NativeOverlay-build.log
- name: Run six pod XCTest suites on iOS Simulator
shell: bash
run: |
Expand Down Expand Up @@ -239,5 +292,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ios-native-test-results
path: artifacts/ios/
path: |
artifacts/ios/
example/react-native/ios/Podfile.lock
if-no-files-found: warn
14 changes: 9 additions & 5 deletions .github/workflows/package-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
outputs:
dist_tag: ${{ steps.channel.outputs.dist_tag }}
release_version: ${{ steps.release.outputs.version }}
package_count: ${{ steps.release.outputs.package_count }}
env:
ONLY_WORKSPACE: ${{ inputs.only_workspace || '' }}
steps:
Expand All @@ -60,7 +61,7 @@ jobs:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version: '24.x'
node-version: "24.x"
registry-url: "https://registry.npmjs.org"
- name: Select release channel
id: channel
Expand Down Expand Up @@ -97,6 +98,8 @@ jobs:
run: |
version=$(node -p "require('./native-views/react-native-native-list/package.json').version")
echo "version=$version" >> "$GITHUB_OUTPUT"
count=$(node --input-type=module -e 'import { loadReleaseWorkspaces } from "./scripts/validate-npm-dist-tag.mjs"; console.log((await loadReleaseWorkspaces(process.cwd())).length)')
echo "package_count=$count" >> "$GITHUB_OUTPUT"
echo "Published version: $version" >> "$GITHUB_STEP_SUMMARY"
- name: Validate release version and dist-tag
env:
Expand Down Expand Up @@ -133,6 +136,7 @@ jobs:
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ needs.package-publish.outputs.release_version }}
RELEASE_PACKAGE_COUNT: ${{ needs.package-publish.outputs.package_count }}
steps:
- name: Create read-only app-monorepo token
id: read-token
Expand All @@ -158,12 +162,12 @@ jobs:
- uses: actions/setup-node@v6
with:
node-version: "24.x"
- name: Update only app-modules mobile dependencies
- name: Update app-modules dependencies across consumers
id: dependencies
working-directory: app-monorepo
run: |
node ../app-modules/scripts/sync-app-monorepo.mjs . "$RELEASE_VERSION"
if git diff --quiet -- apps/mobile/package.json packages/components/package.json package.json; then
if git diff --quiet -- apps/mobile/package.json packages/components/package.json packages/kit/package.json apps/playground/package.json package.json; then
echo 'changed=false' >> "$GITHUB_OUTPUT"
else
echo 'changed=true' >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -198,7 +202,7 @@ jobs:
branch="codex/app-modules-v${version}"
git config user.name 'onekey-release[bot]'
git config user.email 'onekey-release[bot]@users.noreply.github.com'
git add -u apps/mobile/package.json packages/components/package.json package.json yarn.lock
git add -u apps/mobile/package.json packages/components/package.json packages/kit/package.json apps/playground/package.json package.json yarn.lock
git diff --cached --check
git commit -m "chore: update app-modules to ${version}"
gh auth setup-git
Expand All @@ -208,7 +212,7 @@ jobs:
else
git push origin "HEAD:refs/heads/${branch}"
fi
body="Update app-modules mobile dependencies to ${version} after all 41 packages passed npm registry verification. Source: ${GITHUB_REPOSITORY}@${GITHUB_SHA}. Module-ID registry structure is checked; new native runtime modules require a fresh Union Build map before registry update."
body="Update app-modules mobile dependencies to ${version} after all ${RELEASE_PACKAGE_COUNT} packages passed npm registry verification. Source: ${GITHUB_REPOSITORY}@${GITHUB_SHA}. Module-ID registry structure is checked; new native runtime modules require a fresh Union Build map before registry update."
pr_number=$(gh pr list --repo OneKeyHQ/app-monorepo --state open --base x --head "$branch" --json number,headRepositoryOwner --jq "[.[] | select(.headRepositoryOwner.login == \"$GITHUB_REPOSITORY_OWNER\")][0].number")
if test -n "$pr_number"; then
gh pr edit "$pr_number" --repo OneKeyHQ/app-monorepo --title "chore: update app-modules to ${version}" --body "$body"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ yarn create:view <view-name>

## Release automation

Every merged same-repository PR is classified by whether it changes a publishable workspace version. A change without version updates gets an ephemeral next-patch `-alpha.<workflow run number>` version across all publishable packages and is published with the npm `next` tag; those preview versions are not committed back to `main`. A change that updates package versions publishes the exact synchronized stable version from the PR with the npm `latest` tag, without another automatic version or changelog change. After registry verification, both preview and latest releases open an app-monorepo PR against `x` for the mobile, components, root dependency pins, and lockfile updates. Source PR approval is therefore also release approval.
Every merged same-repository PR is classified by whether it changes a publishable workspace version. A change without version updates gets an ephemeral next-patch `-alpha.<workflow run number>` version across all publishable packages and is published with the npm `next` tag; those preview versions are not committed back to `main`. A change that updates package versions publishes the exact synchronized stable version from the PR with the npm `latest` tag, without another automatic version or changelog change. After registry verification, both preview and latest releases open an app-monorepo PR against `x` for the mobile, components, kit, playground, root dependency pins, and lockfile updates. Source PR approval is therefore also release approval.

Merged fork PRs are intentionally skipped with a workflow summary notice; run `package-publish` manually when ready. The manual action remains available for `next`, `latest`, and single-workspace recovery.

Expand Down
Loading
Loading