-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'NervJS:next' into next
- Loading branch information
Showing
488 changed files
with
64,399 additions
and
12,410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
name: publish | ||
on: | ||
# When Release Pull Request is merged | ||
push: | ||
branches: | ||
- next | ||
pull_request: | ||
branches: | ||
- next | ||
types: [closed] | ||
|
||
env: | ||
CI: true | ||
jobs: | ||
publish: | ||
name: publish | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: [14.x] | ||
|
||
steps: | ||
# Setup | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup Node ${{ matrix.node_version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Git Identity | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Log meta | ||
- name : GITHUB CONTEXT | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
|
||
# Get commit message | ||
- name: Get commit message | ||
run: | | ||
COMMIT_MESSAGE=$(git log --format=%B -n 1) | ||
echo "commitmsg=${COMMIT_MESSAGE}" >> $GITHUB_ENV | ||
- name: Show commit message | ||
run : echo "$commitmsg" | ||
|
||
# Define ${CURRENT_VERSION} | ||
- name: Set Current Version | ||
if: startsWith( env.commitmsg , 'chore(release):' ) | ||
shell: bash -ex {0} | ||
run: | | ||
CURRENT_VERSION=$(node -p 'require("./lerna.json").version') | ||
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV | ||
# Check git tag | ||
- name: Tag Check | ||
if: startsWith( env.commitmsg , 'chore(release):' ) | ||
id: tag_check | ||
shell: bash -ex {0} | ||
run: | | ||
GET_API_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/git/ref/tags/v${CURRENT_VERSION}" | ||
http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s \ | ||
-H "Authorization: token ${GITHUB_TOKEN}") | ||
if [ "$http_status_code" -ne "404" ] ; then | ||
echo "::set-output name=exists_tag::true" | ||
else | ||
echo "::set-output name=exists_tag::false" | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Bootstrap project | ||
- name: install | ||
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false' | ||
run: yarn | ||
- name: bootstrap | ||
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false' | ||
run: yarn run bootstrap | ||
- name: build | ||
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false' | ||
run: yarn build | ||
|
||
# Git stash | ||
- name: Drop current changes | ||
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false' | ||
run: | | ||
git add . | ||
git stash | ||
# Create git tag | ||
- name: Create Git Tag | ||
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false' | ||
uses: azu/action-package-version-to-git-tag@v1 | ||
with: | ||
version: ${{ env.CURRENT_VERSION }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
github_repo: ${{ github.repository }} | ||
git_commit_sha: ${{ github.sha }} | ||
git_tag_prefix: "v" | ||
|
||
# Publish | ||
- name: npm publish | ||
if: steps.tag_check.outputs.exists_tag == 'false' && startsWith( env.commitmsg , 'chore(release):' ) | ||
run: yarn lerna publish from-package --yes | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
# Create relase when event is PR | ||
- name: Create Release | ||
id: create_release | ||
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false' && github.event.pull_request.merged == true | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ env.CURRENT_VERSION }} | ||
# Copy Pull Request's tile and body to Release Note | ||
release_name: ${{ github.event.pull_request.title }} | ||
body: | | ||
${{ github.event.pull_request.body }} | ||
draft: false | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
on: | ||
push: | ||
tags: [ v* ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
taro_release_job: | ||
runs-on: ubuntu-latest | ||
name: Taro Bundle Release | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@v2 | ||
- name: Cache node_modules Folder | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ github.workspace }}/node_modules | ||
key: ${{ runner.os }}-node_modules | ||
restore-keys: ${{ runner.os }}-node_modules | ||
- name: Get Yarn Cache Directory Path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- name: Cache Yarn | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install Dependencies | ||
run: | | ||
yarn | ||
- name: Lerna Bootstrap | ||
run: | | ||
yarn bootstrap | ||
- name: Release Taro React Native bundle | ||
uses: zhiqingchen/taro-react-native-release@v1 | ||
with: | ||
workingdirectory: ./packages/taro-ui-demo-rn | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
appname: Taro-UI-Demo | ||
logo: https://pic5.58cdn.com.cn/nowater/fangfe/n_v25a185c1657984016926f26af591912c4.jpg | ||
- name: Upload Qr Image | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: bundle-qr-code | ||
path: | | ||
packages/taro-ui-demo-rn/release/qrcode/ios.png | ||
packages/taro-ui-demo-rn/release/qrcode/android.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,6 @@ stats.html | |
|
||
# Test files | ||
coverage | ||
|
||
# taro rn release | ||
!packages/taro-ui-demo-rn/release/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Taro UI For RN | ||
|
||
|
||
### 开发 | ||
|
||
|
||
#### 壳 | ||
注意 React Native 版本需要保持一致 | ||
##### 自定义安装壳子 | ||
下载官方壳应用(NervJS/taro-native-shell)[https://github.com/NervJS/taro-native-shell] 选择与 taro-ui react-native 版本一致的分支 | ||
|
||
##### 使用发布商店 App 壳子 | ||
<img src="https://tva1.sinaimg.cn/large/008i3skNgy1gvzhk2732kj30fu0u0aax.jpg" width="300px" /> | ||
|
||
``` | ||
# 组件库与 demo 连接,lerna 对 packages 进行 symlink | ||
lerna bootstrap | ||
``` | ||
|
||
#### 组件开发 | ||
``` | ||
cd packages/taro-ui/rn | ||
``` | ||
|
||
#### 发布 | ||
rn 源码发布 | ||
|
||
#### DEMO 启动 | ||
``` | ||
cd packages/taro-ui-demo-rn | ||
yarn dev:rn | ||
``` | ||
demo 适配开发,更改组件 style 样式,需要更改一下 packages/taro-ui-demo-rn/src/app.scss 触发一下样式重编。 | ||
|
||
#### DEMO release | ||
需要打一个 tag,比如: | ||
```sh | ||
git tag -a 'v3.1.0-beta.3-rn' -m 'rn qrcode for v3.1.0-beta.3' | ||
git push origin v3.1.0-beta.3-rn | ||
``` | ||
git ci 部署,最后生成 release 信息 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Change Log | ||
|
||
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
## 3.0.1 (2020-04-18) | ||
|
||
**Note:** Version bump only for package taro-ui-demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// babel-preset-taro 更多选项和默认值: | ||
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md | ||
module.exports = { | ||
presets: [ | ||
[ | ||
'taro', | ||
{ | ||
framework: 'react', | ||
ts: true | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
env: { | ||
NODE_ENV: '"development"' | ||
}, | ||
defineConstants: {}, | ||
weapp: {}, | ||
h5: {} | ||
} |
Oops, something went wrong.