Skip to content

Commit

Permalink
Adjust CI/CD (#1)
Browse files Browse the repository at this point in the history
* ci: ci config
  • Loading branch information
guoxianzhe authored Nov 20, 2023
1 parent 2cd4cd7 commit dc256f3
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 42 deletions.
18 changes: 18 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@ runs:
with:
node-version-file: .nvmrc

- name: Setup Ruby
if: ${{ runner.os == 'macOS' }}
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Setup activesupport
if: ${{ runner.os == 'macOS' }}
run:
gem install activesupport -v 7.0.8
shell: bash

- name: Setup Cocoapods
if: ${{ runner.os == 'macOS' }}
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.13.0

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
turbo_cache_hit: 0
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup
Expand Down Expand Up @@ -78,24 +78,24 @@ jobs:
name: AgoraRtmNgExample
path: |
example/android/app/build/outputs/apk/release/*.apk
if-no-files-found: error

build-ios:
if: ${{ contains(github.event.pull_request.labels.*.name, 'ci:dep-update') }}
# if: ${{ contains(github.event.pull_request.labels.*.name, 'ci:dep-update') }}
runs-on: macos-latest
env:
TURBO_CACHE_DIR: .turbo/ios
turbo_cache_hit: 0
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Setup cocoapods
- name: Setup fastlane
run: |
gem install cocoapods -v 1.13.0
gem install activesupport -v 7.0.8
brew install fastlane
- name: Cache turborepo for iOS
uses: actions/cache@v3
Expand Down Expand Up @@ -174,17 +174,19 @@ jobs:
name: AgoraRtmNgExample
path: |
example/ios/*.ipa
if-no-files-found: error

- name: Upload dSYM
uses: actions/upload-artifact@v3
with:
name: AgoraRtmNgExampleSymbol
path: |
example/ios/*.dSYM.zip
if-no-files-found: error

# notification:
# runs-on: ubuntu-latest
# needs: [ build-android, build-ios ]
# steps:
# - run: |
# curl -X POST "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${{ secrets.WECHAT_KEY }}" -d '{"msgtype":"text","text":{"content":"ReactNative:\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}}'
notification:
runs-on: ubuntu-latest
needs: [build-android, build-ios]
steps:
- run: |
curl -X POST "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${{ secrets.WECHAT_KEY }}" -d '{"msgtype":"text","text":{"content":"[RTM]ReactNative Example:\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\nDownload Link:\nhttps://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}"}}'
37 changes: 36 additions & 1 deletion .github/workflows/dep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup
Expand Down Expand Up @@ -46,3 +46,38 @@ jobs:
Dependencies content:
${{ steps.dep.outputs.matches }}
update-pod:
runs-on: macos-latest
needs: update-dependencies
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}-dep-update
token: ${{ secrets.GH_TOKEN }}

- name: Setup
uses: ./.github/actions/setup

- name: Cache cocoapods
id: cocoapods-cache
uses: actions/cache@v3
with:
path: |
**/ios/Pods
key: ${{ runner.os }}-cocoapods-0-${{ hashFiles('example/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-cocoapods-0-
- name: Update Podfile.lock
run: |
pod update
working-directory: example/ios

- name: Commit changes
run: |
git config --global user.email "${{ secrets.GIT_EMAIL }}"
git config --global user.name "${{ secrets.GIT_USERNAME }}"
git add example
git commit -m "chore(example): update Podfile.lock by new dependencies"
git push
2 changes: 1 addition & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gitleaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:
push:
workflow_dispatch:
schedule:
- cron: "0 4 * * *" # run once a day at 4 AM
- cron: '0 4 * * *' # run once a day at 4 AM

jobs:
scan:
name: gitleaks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/terra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ on:
terra-ref:
description: The terra repo ref
required: true
default: "main"
default: 'main'

jobs:
generate-codes:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typedoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
environment: github-pages
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Build TypeDoc
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ lib/
ios/AgoraRtmWrapper.podspec
env_local.*
docs/
example/ios/*.dSYM.zip


.terra
Binary file removed example/example.jpg
Binary file not shown.
30 changes: 8 additions & 22 deletions example/ios/AgoraRtmNgExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 58665V34ZZ;
DEVELOPMENT_TEAM = PV44H27855;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = AgoraRtmNgExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -341,7 +341,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = io.agora.AgoraRtmNgExample;
PRODUCT_NAME = AgoraRtmNgExample;
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE_SPECIFIER = AgoraQA2021;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
Expand All @@ -359,9 +359,9 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 58665V34ZZ;
DEVELOPMENT_TEAM = PV44H27855;
INFOPLIST_FILE = AgoraRtmNgExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -375,7 +375,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = io.agora.AgoraRtmNgExample;
PRODUCT_NAME = AgoraRtmNgExample;
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE_SPECIFIER = AgoraQA2021;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
Expand Down Expand Up @@ -454,14 +454,7 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
"-Wl",
"-ld_classic",
"-Wl -ld_classic ",
);
OTHER_LDFLAGS = "$(inherited)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
};
Expand Down Expand Up @@ -531,14 +524,7 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
"-Wl",
"-ld_classic",
"-Wl -ld_classic ",
);
OTHER_LDFLAGS = "$(inherited)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand Down

0 comments on commit dc256f3

Please sign in to comment.