Hippy version management follows principle that all modules use same version.
The front-end Uses lerna for versioning and CHANGELOG generation, but cannot use its publishing functionality because it needs to update the terminal package.
Update version and CHANGELOG usage:
npx lerna version [VERSION] --force-publish --conventional-commits --tag-version-prefix='' --no-push
[version]
- The version number to be released, such as 2.1.0.--conventional-commits
- Generates a CHANGELOG based on the conventional commit specification.--tag-version-prefix
- it is changed to a null character, so that the generated version number tag is not preceded by the defaultv
--no-push
- it does not push tags to remote.
After Lerna generates the version number and CHANGELOG, it needs to roll back the version, and all the published changes need to be merged into a commit.
git reset --soft HEAD^
Delete the tag at the same time, after a while update need to regenerate the tag
git tag -d [VERSION]
The native version number is mainly located in the following files, which need to be updated to the version number to be released
iOS
Android
修改安卓的abi配置,支持armeabi-v7a和arm64-v8a
INCLUDE_ABI_ARMEABI_V7A=true
INCLUDE_ABI_ARM64_V8A=true
The new front-end SDK is then compiled with
npm run build
If some code updated under core/js
, you need to compile the core code with
npm run buildcore
Then update the dependencies under the target examples
and update the built-in packages of the native. Generally speaking, the built-in hippy-react-demo is the default, but be sure to check that hippy-vue-demo functions properly.
npm run buildexample hippy-react-demo
Check again that all files have been modified correctly
git status
Submit document modification
git add [FILES]
Enter a commit message that conforms to Convention Commit specifications
git commit -m 'chore(release): released [VERSION]'
tag (如果是大版本, 在主干打tag, 如果是hotfix,在hotfix分支打tag,然后把changelog合回主干)
git tag -a [VERSION] -m "version release xxx"
Commit the code and prepare to publish the PR merge into the master branch.
git push origin branch # 提交代码
git push origin tag # 提交 tag
-
Front End Publishing to npmjs.com
npx lerna exec "npm publish"
If npm secondary authentication is active, you will be asked to input a one-time password.
-
iOS published to CocoaPods.org
- If you do not have a CocoaPod account, register first
pod trunk register [EMAIL] [NAME]
- Then publish
pod trunk push hippy.podspec
If the parameter check fails when publishing, you can prefix the
pod
commandCOCOAPODS_VALIDATOR_SKIP_XCODEBUILD=1
parameter -
Android released to Maven Central, the original jCenter repository has been abandoned version query.
-
Follow the steps for publishing Maven Central and sign up for sonatype.
-
Increase the system environment variable configuration
SIGNING_KEY_ID=gpg公钥key后8位 SIGNING_PASSWORD=gpg密钥对密码 SIGNING_SECRET_KEY_RING_FILE=gpg文件存放路径, 如/Users/user/.gnupg/secring.gpg OSSRH_USERNAME=sonatype账号 OSSRH_PASSWORD=sonatype密码
-
Run build
Clean Project
-
Android gradle.properties
turns on the#PUBLISH_ARTIFACT_ID=hippy-debug
comment, and the Gradle Task executesother
=>assembleDebug
beforepublishing
=>publish
-
Android gradle.properties
turns on the#PUBLISH_ARTIFACT_ID=hippy-common
comment, and the Gradle Task executesother
=>assembleRelease
beforepublishing
=>publish
-
After the success of the release of the SDK will be in the
staging
state of Sonatype, in the left sideStaging Repositories
of the Sonatype Staging Repositories to find just released repository, if you want to test before Release, can be under theContent
willaar
download, replaceexamples
=>android-demo
=>example
=>libs
under the aar(name toandroid-sdk-release.aar
)// annotation local reference in `setting.gradle` // include 'android-sdk' // project(':android-sdk').projectDir = new File('../../ android/sdk') -------------- // `android-demo` => `example` => `build.gradle` dependencies can be changed as follow to use local aar file if (1) { api (name: 'android-sdk-release', ext: 'aar') } else { api project(path: ':android-sdk') }
-
After successful verification, Close the repository of
Staging Repositories``Close
and clickRelease
. -
After the success of the Release can be searched in the Repository to the corresponding version of aar, Maven home page need to wait for more than 2 hours to synchronize
-