Skip to content

Commit

Permalink
Merge branch 'main' into fix/six_key_point
Browse files Browse the repository at this point in the history
  • Loading branch information
siguangli authored Apr 12, 2024
2 parents a5919fe + d62d926 commit 68f0a4c
Show file tree
Hide file tree
Showing 128 changed files with 2,157 additions and 19,967 deletions.
134 changes: 134 additions & 0 deletions .github/workflows/project_artifact_snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: '[project] artifact snapshot'

on:
workflow_dispatch:
inputs:
git_ref:
description: 'Git Ref'
type: string
required: true
version_name:
description: 'Version name'
type: string
required: true
registry_choice:
description: 'Registry choice'
type: choice
required: true
default: 'Both'
options:
- Default
- Github
- Both
is_release_for_android:
description: 'Release for Android'
type: boolean
default: true
required: false

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
context_in_lowercase:
if: github.event.inputs.is_release_for_android == 'true'
runs-on: ubuntu-latest
outputs:
repository_owner: ${{ steps.get_owner.outputs.lowercase }}
steps:
- name: Get repo owner(in lowercase)
id: get_owner
uses: ASzc/change-string-case-action@v2
with:
string: ${{ github.repository_owner }}

android_release:
if: github.event.inputs.is_release_for_android == 'true'
needs: context_in_lowercase
runs-on: ubuntu-latest
strategy:
matrix:
build_type: [Release]
include:
- build_type: Release
artifact_id: hippy-snapshot
container:
image: ghcr.io/${{ needs.context_in_lowercase.outputs.repository_owner }}/android-release:latest
steps:
- name: Checkout (${{ github.event.inputs.git_ref }})
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.git_ref }}
lfs: true
- name: ${{ matrix.build_type }} build
env:
SIGNING_KEY_ID: ${{ secrets.ANDROID_SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }}
SIGNING_SECRET_KEY: ${{ secrets.ANDROID_SIGNING_SECRET_KEY }}
run: |
./gradlew assemble${{ matrix.build_type }} -PVERSION_NAME=${{ github.event.inputs.version_name }} -PPUBLISH_ARTIFACT_ID=${{ matrix.artifact_id }} -PINCLUDE_ABI_X86=true -PINCLUDE_ABI_X86_64=true
./gradlew signMavenAarPublication
- name: Pre Archive artifacts
shell: bash
run: |
pip3 install -U cos-python-sdk-v5
- name: Archive artifacts
working-directory: ./framework/android/build
shell: python3 {0}
run: |
from qcloud_cos import CosConfig
from qcloud_cos import CosS3Client
from urllib.parse import urlencode
import os
import tempfile
import zipfile
artifacts = [("outputs/aar/android-sdk.aar", "hippy/android/${{ matrix.artifact_id }}/${{ github.event.inputs.version_name }}/android-sdk.aar")]
for path, dirs, files in os.walk("intermediates/merged_native_libs/%s/out/lib" % "${{ matrix.build_type }}".lower()):
if files:
with zipfile.ZipFile(tempfile.mkstemp()[1], "w", zipfile.ZIP_DEFLATED) as zip_file:
for file in files:
zip_file.write(os.path.join(path, file), file)
artifacts.append((zip_file.filename, "hippy/android/${{ matrix.artifact_id }}/${{ github.event.inputs.version_name }}/symbols/%s.zip" % os.path.basename(path)))
metadata = {}
metadata["ci-name"] = "Github Action"
metadata["ci-id"] = "${{ github.run_id }}"
metadata["ci-url"] = "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
metadata["artifact-author"] = "${{ github.event.sender.login }}"
metadata["git-ref"] = "${{ github.event.inputs.git_ref }}"
config = CosConfig(Region="${{ secrets.COS_REGION }}", SecretId="${{ secrets.TC_SECRET_ID }}", SecretKey="${{ secrets.TC_SECRET_KEY }}")
client = CosS3Client(config)
for artifact in artifacts:
print("Uploading %s" % artifact[0])
response = client.upload_file(
Bucket="${{ secrets.COS_BUCKET_ARTIFACTS_STORE }}",
Key=artifact[1],
LocalFilePath=artifact[0],
Metadata={"x-cos-tagging": urlencode(metadata)}
)
print("Archived %s" % artifact[1])
- name: Publish to Github Packages
if: github.event.inputs.registry_choice == 'Both' || github.event.inputs.registry_choice == 'Github'
env:
SIGNING_KEY_ID: ${{ secrets.ANDROID_SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }}
SIGNING_SECRET_KEY: ${{ secrets.ANDROID_SIGNING_SECRET_KEY }}
MAVEN_USERNAME: ${{ secrets.GITHUB_ACTOR }}
MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
MAVEN_URL: https://maven.pkg.github.com/${{ github.repository }}
run: |
./gradlew publish -PVERSION_NAME=${{ github.event.inputs.version_name }} -PPUBLISH_ARTIFACT_ID=${{ matrix.artifact_id }} -PINCLUDE_ABI_X86=true -PINCLUDE_ABI_X86_64=true
- name: Publish to OSSRH
if: github.event.inputs.registry_choice == 'Both' || github.event.inputs.registry_choice == 'Default'
env:
SIGNING_KEY_ID: ${{ secrets.ANDROID_SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }}
SIGNING_SECRET_KEY: ${{ secrets.ANDROID_SIGNING_SECRET_KEY }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: |
./gradlew publish -PVERSION_NAME=${{ github.event.inputs.version_name }} -PPUBLISH_ARTIFACT_ID=${{ matrix.artifact_id }} -PINCLUDE_ABI_X86=true -PINCLUDE_ABI_X86_64=true
10 changes: 8 additions & 2 deletions PUBLISH.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ Android

* [gradle.properties](https://github.com/Tencent/Hippy/blob/master/android/sdk/gradle.properties#L25)

修改安卓的abi配置,支持armeabi-v7a和arm64-v8a
```
INCLUDE_ABI_ARMEABI_V7A=true
INCLUDE_ABI_ARM64_V8A=true
```

## 4. Update built-in packages and verify functionality

The new front-end SDK is then compiled with
Expand Down Expand Up @@ -93,8 +99,8 @@ git tag -a [VERSION] -m "version release xxx"
Commit the code and prepare to publish the PR merge into the master branch.

```bash
git push # 提交代码
git push --tags # 提交 tag
git push origin branch # 提交代码
git push origin tag # 提交 tag
```

## 6. Publish
Expand Down
6 changes: 2 additions & 4 deletions docs/api/hippy-react/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,15 +516,13 @@ import icon from './qb_icon_new.png';
| interItemSpacing | item 间的垂直间距 | `number` | `Android、iOS、Voltron` |
| contentInset | 内容缩进 ,默认值 `{ top:0, left:0, bottom:0, right:0 }` | `Object` | `Android、iOS、Voltron` |
| renderItem | 这里的入参是当前 item 的 index,在这里可以凭借 index 获取到瀑布流一个具体单元格的数据,从而决定如何渲染这个单元格。 | `(index: number) => React.ReactElement` | `Android、iOS、Voltron` |
| renderBanner | 如何渲染 Banner。 | `() => React.ReactElement` | `iOS、Voltron`
| renderBanner | 如何渲染 Banner。 | `() => React.ReactElement` | `Android、iOS、Voltron`
| getItemStyle | 设置`WaterfallItem`容器的样式。 | `(index: number) => styleObject` | `Android、iOS、Voltron` |
| getItemType | 指定一个函数,在其中返回对应条目的类型(返回Number类型的自然数,默认是0),List 将对同类型条目进行复用,所以合理的类型拆分,可以很好地提升list 性能。 | `(index: number) => number` | `Android、iOS、Voltron` |
| getItemKey | 指定一个函数,在其中返回对应条目的 Key 值,详见 [React 官文](//reactjs.org/docs/lists-and-keys.html) | `(index: number) => any` | `Android、iOS、Voltron` |
| preloadItemNumber | 滑动到瀑布流底部前提前预加载的 item 数量 | `number` | `Android、iOS、Voltron` |
| onEndReached | 当所有的数据都已经渲染过,并且列表被滚动到最后一条时,将触发 `onEndReached` 回调。 | `Function` | `Android、iOS、Voltron` |
| containPullHeader | 是否包含`PullHeader`组件,默认 `false``Android` 暂不支持,可暂时用 `RefreshWrapper` 组件替代 | `boolean` | `iOS、Voltron` |
| renderPullHeader | 如何渲染 `PullHeader`,此时 `containPullHeader` 默认设置成 `true` | `() => React.ReactElement` | `iOS、Voltron` |
| containPullFooter | 是否包含`PullFooter`组件,默认 `false` | `boolean` | `Android、iOS、Voltron` |
| renderPullHeader | 如何渲染 `PullHeader`,此时 `containPullHeader` 默认设置成 `true` | `() => React.ReactElement` | `Android、iOS、Voltron` |
| renderPullFooter | 如何渲染 `PullFooter`,此时 `containPullFooter` 默认设置成 `true` | `() => React.ReactElement` | `Android、iOS、Voltron` |
| onScroll | 当触发 `WaterFall` 的滑动事件时回调。`startEdgePos`表示距离 List 顶部边缘滚动偏移量;`endEdgePos`表示距离 List 底部边缘滚动偏移量;`firstVisibleRowIndex`表示当前可见区域内第一个元素的索引;`lastVisibleRowIndex`表示当前可见区域内最后一个元素的索引;`visibleRowFrames`表示当前可见区域内所有 item 的信息(x,y,width,height) | `nativeEvent: { startEdgePos: number, endEdgePos: number, firstVisibleRowIndex: number, lastVisibleRowIndex: number, visibleRowFrames: Object[] }` | `Android、iOS、Voltron`

Expand Down
3 changes: 1 addition & 2 deletions docs/development/android-3.0-integration-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
下面引用Hippy最新版本号可在上述链接中查询

```java
// implementation 'com.tencent.hippy:hippy-debug:3.2.0-beta'
implementation 'com.tencent.hippy:hippy-release:3.2.0-beta'
implementation 'com.tencent.hippy:hippy-snapshot:3.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.viewpager:viewpager:1.0.0'
Expand Down
34 changes: 17 additions & 17 deletions docs/development/react-vue-3.0-upgrade-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@

``` javascript
1)删除 react-reconciler 依赖
2)@hippy/react 升级到 3.0.2-beta 以上
3)新增 @hippy/react-reconciler 依赖,使用react17的tag,即 @hippy/react-reconciler: react17
2)@hippy/react 升级到 3.2.0-beta 及以上
3)新增 @hippy/react-reconciler 依赖,使用react17的tag,即 @hippy/react-reconciler: "react17"
4)React 版本升级到 17,即 react: "^17.0.2"
5)如果使用了 @hippy/react-web 包做h5同构,则需要升级 @hippy/react-web 到 3.0.2-beta 以上
5)如果使用了 @hippy/react-web 包做h5同构,则需要升级 @hippy/react-web 到 3.2.0-beta 及以上
```

如果当前 @hippy/react 版本大于 2.12.0, 且 React 使用的 17 的版本,则需要升级如下版本:

``` javascript
1)@hippy/react 升级到 3.0.2-beta 以上
2)升级 @hippy/react-reconciler 依赖,使用react17的tag,即 @hippy/react-reconciler: react17
3)如果使用了 @hippy/react-web 包做h5同构,则需要升级 @hippy/react-web 到 3.0.2-beta 以上
1)@hippy/react 升级到 3.2.0-beta 及以上
2)升级 @hippy/react-reconciler 依赖,使用react17的tag,即 @hippy/react-reconciler: "react17"
3)如果使用了 @hippy/react-web 包做h5同构,则需要升级 @hippy/react-web 到 3.2.0-beta 及以上
```

Hippy-React 在升级3.0可以完全兼容之前的版本,除了升级如上依赖,业务代码不需要做修改。
Expand All @@ -39,12 +39,12 @@ Hippy-React 在升级3.0可以完全兼容之前的版本,除了升级如上
需要升级如下版本依赖:

``` javascript
1)@hippy/vue 升级到 3.0.2-beta 以上
2)@hippy/vue-native-components 升级到 3.0.2-beta 以上
3)@hippy/vue-router 升级到 3.0.2-beta 以上
4)@hippy/vue-css-loader 升级到 3.0.2-beta 以上
5)@hippy/vue-loader 升级到 3.0.2-beta 以上
6)vue 和 vue-router等vue相关依赖无需升级
1)@hippy/vue 升级到 3.2.0-beta 及以上
2)@hippy/vue-native-components 升级到 3.2.0-beta 及以上
3)@hippy/vue-router 升级到 3.2.0-beta 及以上
4)@hippy/vue-css-loader 升级到 3.2.0-beta 及以上
5)@hippy/vue-loader 升级到 3.2.0-beta 及以上
6)vue 和 vue-router 等vue相关依赖无需升级
```

Hippy-Vue 在升级3.0可以完全兼容之前的版本,除了升级如上依赖,业务代码不需要做修改。
Expand All @@ -59,9 +59,9 @@ Hippy-Vue 在升级3.0可以完全兼容之前的版本,除了升级如上依
需要升级如下版本依赖:

``` javascript
1)@hippy/vue-next 升级到 3.0.2-beta 以上
2)@hippy/vue-router-next-history 升级到 3.0.2-beta 以上
3)@hippy/vue-css-loader 升级到 3.0.2-beta 以上
1)@hippy/vue-next 升级到 3.2.0-beta 及以上
2)@hippy/vue-css-loader 升级到 3.2.0-beta 及以上
3)@hippy/vue-router-next-history 升级到 0.0.1
4)vue 和 vue-router 等vue相关依赖无需升级
```

Expand Down Expand Up @@ -94,8 +94,8 @@ Hippy-Vue-Next 在升级3.0可以完全兼容之前的版本,除了升级如

## Performance API

Hippy 3.0 我们实现了基于前端规范设计的性能 API,接入方式可参考 [performance](feature/feature3.0/performance.md)
Hippy 3.0 我们实现了基于前端规范设计的性能 API,接入方式可参考 [Performance](feature/feature3.0/performance.md)

## Layout 引擎支持切换

Hippy 3.0 我们支持了 Layout 引擎的无缝切换,项目可保持`Yoga`引擎,也可以选择Hippy自研的`Taitank`引擎。详情可参考 [layout](feature/feature3.0/layout.md)
Hippy 3.0 我们支持了 Layout 引擎的无缝切换,项目可保持`Yoga`引擎,也可以选择Hippy自研的`Taitank`引擎。详情可参考 [Layout](feature/feature3.0/layout.md)
Loading

0 comments on commit 68f0a4c

Please sign in to comment.