Skip to content

Commit 14d133b

Browse files
committed
init taro 4.0.9
0 parents  commit 14d133b

File tree

83 files changed

+22646
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+22646
-0
lines changed

.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": ["taro/react"],
3+
"rules": {
4+
"react/jsx-uses-react": "off",
5+
"react/react-in-jsx-scope": "off"
6+
}
7+
}

.github/scripts/import-certificate.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
security create-keychain -p "" build.keychain
6+
security list-keychains -s build.keychain
7+
security default-keychain -s build.keychain
8+
security unlock-keychain -p "" build.keychain
9+
security set-keychain-settings
10+
echo $SIGNING_CERTIFICATE_P12_DATA | base64 --decode > signingCertificate.p12
11+
security import signingCertificate.p12 \
12+
-f pkcs12 \
13+
-k build.keychain \
14+
-P $SIGNING_CERTIFICATE_PASSWORD \
15+
-T /usr/bin/codesign
16+
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain

.github/scripts/import-profile.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
6+
echo "$PROVISIONING_PROFILE_DATA" | base64 --decode > ~/Library/MobileDevice/Provisioning\ Profiles/profile.mobileprovision
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# 工作流名称
2+
name: Assemble Android Debug
3+
4+
# 触发工作流程的事件
5+
on:
6+
push:
7+
branches: [ main ]
8+
tags: [ v* ]
9+
pull_request:
10+
branches: [ main ]
11+
12+
workflow_dispatch:
13+
14+
# 工作流环境变量
15+
env:
16+
# 应用的application_id
17+
APP_ID: com.tarodemo
18+
# 应用名称
19+
APP_NAME: Taro Demo
20+
# 打包类型
21+
BUILD_TYPE: debug
22+
# 版本名称
23+
VERSION_NAME: 1.0.0
24+
# 版本号
25+
VERSION_CODE: 10
26+
# 密钥库文件
27+
KEYSTORE_FILE: debug.keystore
28+
# 密钥库口令
29+
KEYSTORE_PASSWORD: android
30+
# 密钥库别名
31+
KEYSTORE_KEY_ALIAS: androiddebugkey
32+
# 密钥库别名口令
33+
KEYSTORE_KEY_PASSWORD: android
34+
35+
# 工作流作业
36+
jobs:
37+
assemble:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout Project
41+
uses: actions/checkout@v2
42+
- uses: actions/setup-java@v4
43+
with:
44+
distribution: 'zulu'
45+
java-version: '17'
46+
- uses: pnpm/action-setup@v2
47+
with:
48+
version: 8
49+
- uses: actions/setup-node@v3
50+
with:
51+
node-version: 20
52+
cache: 'pnpm'
53+
- run: pnpm install
54+
- name: Cache Gradle
55+
uses: actions/cache@v2
56+
env:
57+
cache-name: gradle-cache
58+
with:
59+
path: ~/.gradle
60+
key: ${{ runner.os }}-gradle
61+
restore-keys: |
62+
${{ runner.os }}-gradle
63+
- name: Assemble Android ${{ env.BUILD_TYPE }}
64+
run: |
65+
sudo apt install -y ruby-bundler
66+
cd android
67+
bundle update
68+
bundle exec fastlane assemble
69+
env:
70+
KEYSTORE_FILE: ${{ github.workspace }}/android/app/${{ env.KEYSTORE_FILE }}
71+
NODE_PATH: ${{ github.workspace }}/node_modules/.pnpm/node_modules:$NODE_PATH
72+
- name: Upload Android Products
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: app-${{ env.BUILD_TYPE }}
76+
path: ${{ github.workspace }}/android/app/build/outputs/apk/${{ env.BUILD_TYPE }}/app-${{ env.BUILD_TYPE }}.apk
77+
- name: Upload release assets
78+
uses: softprops/action-gh-release@v1
79+
if: startsWith(github.ref, 'refs/tags/')
80+
with:
81+
prerelease: ${{ contains(github.ref, 'beta') }}
82+
files: |
83+
android/app/build/outputs/apk/${{ env.BUILD_TYPE }}/app-${{ env.BUILD_TYPE }}.apk
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# 工作流名称
2+
name: Assemble Android Release
3+
4+
# 触发工作流程的事件
5+
on:
6+
push:
7+
branches: [ main ]
8+
tags: [ v* ]
9+
pull_request:
10+
branches: [ main ]
11+
12+
workflow_dispatch:
13+
14+
# 工作流环境变量
15+
env:
16+
# 应用的application_id
17+
APP_ID: com.tarodemo
18+
# 应用名称
19+
APP_NAME: Taro Demo
20+
# 打包类型
21+
BUILD_TYPE: release
22+
# 版本名称
23+
VERSION_NAME: 1.0.0
24+
# 版本号
25+
VERSION_CODE: 10
26+
# 密钥库文件
27+
KEYSTORE_FILE: debug.keystore
28+
# 密钥库口令
29+
KEYSTORE_PASSWORD: android
30+
# 密钥库别名
31+
KEYSTORE_KEY_ALIAS: androiddebugkey
32+
# 密钥库别名口令
33+
KEYSTORE_KEY_PASSWORD: android
34+
35+
# 工作流作业
36+
jobs:
37+
assemble:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout Project
41+
uses: actions/checkout@v2
42+
- uses: actions/setup-java@v4
43+
with:
44+
distribution: 'zulu'
45+
java-version: '17'
46+
- uses: pnpm/action-setup@v2
47+
with:
48+
version: 8
49+
- uses: actions/setup-node@v3
50+
with:
51+
node-version: 20
52+
cache: 'pnpm'
53+
- run: pnpm install
54+
- name: Cache Gradle
55+
uses: actions/cache@v2
56+
env:
57+
cache-name: gradle-cache
58+
with:
59+
path: ~/.gradle
60+
key: ${{ runner.os }}-gradle
61+
restore-keys: |
62+
${{ runner.os }}-gradle
63+
- name: Assemble Android ${{ env.BUILD_TYPE }}
64+
run: |
65+
sudo apt install -y ruby-bundler
66+
cd android
67+
bundle update
68+
bundle exec fastlane assemble
69+
env:
70+
KEYSTORE_FILE: ${{ github.workspace }}/android/app/${{ env.KEYSTORE_FILE }}
71+
NODE_PATH: ${{ github.workspace }}/node_modules/.pnpm/node_modules:$NODE_PATH
72+
- name: Upload Android Products
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: app-${{ env.BUILD_TYPE }}
76+
path: ${{ github.workspace }}/android/app/build/outputs/apk/${{ env.BUILD_TYPE }}/app-${{ env.BUILD_TYPE }}.apk
77+
- name: Upload release assets
78+
uses: softprops/action-gh-release@v1
79+
if: startsWith(github.ref, 'refs/tags/')
80+
with:
81+
prerelease: ${{ contains(github.ref, 'beta') }}
82+
files: |
83+
android/app/build/outputs/apk/${{ env.BUILD_TYPE }}/app-${{ env.BUILD_TYPE }}.apk
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# 工作流名称
2+
name: Assemble Ios Debug
3+
4+
# 触发工作流程的事件
5+
on:
6+
push:
7+
branches: [ main ]
8+
tags: [ v* ]
9+
pull_request:
10+
branches: [ main ]
11+
12+
workflow_dispatch:
13+
14+
# 工作流环境变量
15+
env:
16+
# 应用的application_id
17+
APP_ID: ${{secrets.APP_ID}}
18+
APP_NAME: Taro Demo
19+
VERSION_NUMBER: 1.0.0
20+
BUILD_TYPE: debug
21+
TEAM_ID: ${{secrets.TEAM_ID}}
22+
PROVISIONING_PROFILE_SPECIFIER: ${{secrets.DEBUG_PROVISIONING_PROFILE_SPECIFIER}}
23+
CODE_SIGN_IDENTITY: Apple Development
24+
SIGNING_CERTIFICATE_P12_DATA: ${{secrets.DEBUG_SIGNING_CERTIFICATE_P12_DATA}}
25+
SIGNING_CERTIFICATE_PASSWORD: ${{secrets.DEBUG_SIGNING_CERTIFICATE_PASSWORD}}
26+
PROVISIONING_PROFILE_DATA: ${{secrets.DEBUG_PROVISIONING_PROFILE_DATA}}
27+
28+
jobs:
29+
assemble:
30+
runs-on: macos-13
31+
steps:
32+
- name: Checkout Project
33+
uses: actions/checkout@v2
34+
- uses: pnpm/action-setup@v2
35+
with:
36+
version: 8
37+
- uses: actions/setup-node@v3
38+
with:
39+
node-version: 20
40+
cache: 'pnpm'
41+
- run: pnpm install
42+
- name: Cache Pods
43+
uses: actions/cache@v2
44+
with:
45+
path: ios/Pods
46+
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
47+
restore-keys: |
48+
${{ runner.os }}-pods-
49+
- name: Install pods
50+
run: cd ios && pod update --no-repo-update
51+
- name: Import signing certificate
52+
env:
53+
SIGNING_CERTIFICATE_P12_DATA: ${{ env.SIGNING_CERTIFICATE_P12_DATA }}
54+
SIGNING_CERTIFICATE_PASSWORD: ${{ env.SIGNING_CERTIFICATE_PASSWORD }}
55+
run: |
56+
exec .github/scripts/import-certificate.sh
57+
- name: Import provisioning profile
58+
env:
59+
PROVISIONING_PROFILE_DATA: ${{ env.PROVISIONING_PROFILE_DATA }}
60+
run: |
61+
exec .github/scripts/import-profile.sh
62+
- name: Build app
63+
env:
64+
FL_APP_IDENTIFIER: ${{ env.APP_ID }}
65+
FL_UPDATE_PLIST_DISPLAY_NAME: ${{ env.APP_NAME }}
66+
FL_UPDATE_PLIST_PATH: taroDemo/Info.plist
67+
FL_VERSION_NUMBER_VERSION_NUMBER: ${{ env.VERSION_NUMBER }}
68+
FL_BUILD_NUMBER_BUILD_NUMBER: ${{ env.BUILD_NUMBER }}
69+
FL_CODE_SIGN_IDENTITY: ${{ env.CODE_SIGN_IDENTITY }}
70+
FL_PROVISIONING_PROFILE_SPECIFIER: ${{ env.PROVISIONING_PROFILE_SPECIFIER }}
71+
FASTLANE_TEAM_ID: ${{ env.TEAM_ID }}
72+
NODE_PATH: ${{ github.workspace }}/node_modules/.pnpm/node_modules:$NODE_PATH
73+
run: |
74+
cd ios
75+
bundle update
76+
bundle exec fastlane build_dev
77+
- name: Upload Ios Products
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: app-${{ env.BUILD_TYPE }}
81+
path: |
82+
${{ github.workspace }}/ios/taroDemo.ipa
83+
${{ github.workspace }}/ios/taroDemo.app.dSYM.zip
84+
- name: Rename release assets
85+
run: |
86+
mv ios/taroDemo.ipa ios/app-${{ env.BUILD_TYPE }}.ipa
87+
mv ios/taroDemo.app.dSYM.zip ios/app-${{ env.BUILD_TYPE }}.app.dSYM.zip
88+
- name: Upload release assets
89+
uses: softprops/action-gh-release@v1
90+
if: startsWith(github.ref, 'refs/tags/')
91+
with:
92+
prerelease: ${{ contains(github.ref, 'beta') }}
93+
files: |
94+
ios/app-${{ env.BUILD_TYPE }}.ipa
95+
ios/app-${{ env.BUILD_TYPE }}.app.dSYM.zip
96+
env:
97+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)