From e8be60bc762db3aac50d025a674664fb9e21c0bd Mon Sep 17 00:00:00 2001 From: Arthas <15215604969@163.com> Date: Wed, 15 Nov 2023 15:24:32 +0800 Subject: [PATCH] feat: suppot native 4.2.6 (#1104) * chore: upgrade to iris 4.2.6-build.1 (#1102) * [AUTO] Update dependencies * chore: wip * chore: wip * chore: wip * chore: wip * chore: wip --------- Co-authored-by: LichKing-2234 * [AUTO] Update dependencies (#1103) * [AUTO] Update dependencies * chore: wip --------- Co-authored-by: LichKing-2234 Co-authored-by: HUI * ci: add `if-no-files-found: error` * chore: wip * chore: wip * fix: jira NMS-17313 * fix: jira NMS-17348 * fix: jira NMS-17334 --------- Co-authored-by: LichKing-2234 Co-authored-by: sda-rob <149643938+sda-rob@users.noreply.github.com> --- .github/actions/setup/action.yml | 5 +++++ .github/workflows/build.yml | 22 ++++++++++++------- .github/workflows/ci.yml | 8 +++---- .github/workflows/dep.yml | 2 +- .github/workflows/doc.yml | 2 +- .github/workflows/gitleaks.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/terra.yml | 4 ++-- .../ChannelMediaRelay/ChannelMediaRelay.tsx | 2 +- .../advanced/Encryption/Encryption.tsx | 5 +++-- .../advanced/RhythmPlayer/RhythmPlayer.tsx | 1 + .../hook/TakeSnapshot/TakeSnapshot.tsx | 1 + package.json | 8 +++---- 13 files changed, 39 insertions(+), 25 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index d677bc5c4..18c4a17ba 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -9,6 +9,11 @@ runs: with: node-version-file: .nvmrc + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.11.5 + - name: Cache dependencies id: yarn-cache uses: actions/cache@v3 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad7c92a9c..0fa409b12 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,9 @@ name: Build API Example / Addon +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: workflow_call: inputs: @@ -20,21 +24,22 @@ on: - sdk release: types: [ published ] + pull_request: + types: [labeled, synchronize] jobs: build-jenkins: + if: ${{ inputs.type == 'sdk' || (github.event_name == 'release' && github.event.action == 'published') }} runs-on: ubuntu-latest steps: - name: Build run: | - type=${{inputs.type}} - type=${type:-"sdk"} curl -X POST -sS -D- -o/dev/null ${{secrets.JENKINS_BUILD_URL}} \ -H 'Content-Type: application/json' \ - -d "{\"branch\": \"${{github.ref_name}}\", \"type\": \"${type}\"}" + -d "{\"branch\": \"${{github.ref_name}}\", \"type\": \"sdk\"}" build-windows: - if: ${{ inputs.type == 'demo' }} + if: ${{ inputs.type == 'demo' || contains(github.event.pull_request.labels.*.name, 'ci:dep-update') }} strategy: matrix: arch: [ ia32, x64 ] @@ -45,7 +50,7 @@ jobs: npm_config_agora_electron_sdk_arch: ${{ matrix.arch }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup uses: ./.github/actions/setup @@ -69,13 +74,13 @@ jobs: name: AgoraRtcNgExample-win-${{ matrix.arch }} path: | example/dist/Agora-Electron-API-Example-*-win.zip - + if-no-files-found: error build-mac: - if: ${{ inputs.type == 'demo' }} + if: ${{ inputs.type == 'demo' || contains(github.event.pull_request.labels.*.name, 'ci:dep-update') }} runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup uses: ./.github/actions/setup @@ -101,6 +106,7 @@ jobs: name: AgoraRtcNgExample-mac path: | example/dist/Agora-Electron-API-Example-*-mac.zip + if-no-files-found: error notification: runs-on: ubuntu-latest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c638e5a53..17c721051 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup uses: ./.github/actions/setup @@ -35,7 +35,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup uses: ./.github/actions/setup @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup uses: ./.github/actions/setup @@ -65,7 +65,7 @@ jobs: runs-on: ${{ matrix.runner }}-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup uses: ./.github/actions/setup diff --git a/.github/workflows/dep.yml b/.github/workflows/dep.yml index f6a0e3953..a33e86e61 100644 --- a/.github/workflows/dep.yml +++ b/.github/workflows/dep.yml @@ -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 diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index ff175641b..ef148990e 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -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 diff --git a/.github/workflows/gitleaks.yml b/.github/workflows/gitleaks.yml index dc9efd47a..c231ecdac 100644 --- a/.github/workflows/gitleaks.yml +++ b/.github/workflows/gitleaks.yml @@ -12,7 +12,7 @@ jobs: name: gitleaks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: gitleaks/gitleaks-action@v2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7993cb127..ee5ec9cb5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 }} diff --git a/.github/workflows/terra.yml b/.github/workflows/terra.yml index 2e249f315..648a2aaae 100644 --- a/.github/workflows/terra.yml +++ b/.github/workflows/terra.yml @@ -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 @@ -38,7 +38,7 @@ jobs: - name: Generate ts interface run: | - yarn ts_interface_builder + yarn build:ts-interface - name: Generate comments uses: ./.github/actions/doc diff --git a/example/src/renderer/examples/advanced/ChannelMediaRelay/ChannelMediaRelay.tsx b/example/src/renderer/examples/advanced/ChannelMediaRelay/ChannelMediaRelay.tsx index 9dd7496e8..d52d72940 100644 --- a/example/src/renderer/examples/advanced/ChannelMediaRelay/ChannelMediaRelay.tsx +++ b/example/src/renderer/examples/advanced/ChannelMediaRelay/ChannelMediaRelay.tsx @@ -220,7 +220,7 @@ export default class ChannelMediaRelay <> { - this.setState({ destChannelNames: text.split(' ') }); + this.setState({ destChannelNames: text ? text.split(' ') : [] }); }} placeholder={'destChannelNames (split by blank)'} value={destChannelNames.join(' ')} diff --git a/example/src/renderer/examples/advanced/Encryption/Encryption.tsx b/example/src/renderer/examples/advanced/Encryption/Encryption.tsx index 4fd044744..f32761919 100644 --- a/example/src/renderer/examples/advanced/Encryption/Encryption.tsx +++ b/example/src/renderer/examples/advanced/Encryption/Encryption.tsx @@ -178,10 +178,11 @@ export default class Encryption { this.setState({ - encryptionKdfSalt: text.split(' ').map((value) => +value), + encryptionKdfSalt: text + ? text.split(' ').map((value) => +value) + : [], }); }} - numberKeyboard={true} placeholder={'encryptionKdfSalt (split by blank)'} value={encryptionKdfSalt.join(' ')} /> diff --git a/example/src/renderer/examples/advanced/RhythmPlayer/RhythmPlayer.tsx b/example/src/renderer/examples/advanced/RhythmPlayer/RhythmPlayer.tsx index 1770f990f..afd3e860e 100644 --- a/example/src/renderer/examples/advanced/RhythmPlayer/RhythmPlayer.tsx +++ b/example/src/renderer/examples/advanced/RhythmPlayer/RhythmPlayer.tsx @@ -124,6 +124,7 @@ export default class RhythmPlayer beatsPerMeasure, beatsPerMinute, }); + this.engine?.updateChannelMediaOptions({ publishRhythmPlayerTrack: true }); }; /** diff --git a/example/src/renderer/examples/hook/TakeSnapshot/TakeSnapshot.tsx b/example/src/renderer/examples/hook/TakeSnapshot/TakeSnapshot.tsx index eda13f886..439a29f9c 100644 --- a/example/src/renderer/examples/hook/TakeSnapshot/TakeSnapshot.tsx +++ b/example/src/renderer/examples/hook/TakeSnapshot/TakeSnapshot.tsx @@ -168,6 +168,7 @@ export default function TakeSnapshot() { value={targetUid} onValueChange={(value) => { setTargetUid(value); + setTakeSnapshot(false); }} /> {takeSnapshot ? ( diff --git a/package.json b/package.json index b04accb3d..9386b4634 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,8 @@ "install": "cross-env-shell gulp NPM_Install \\\"--INIT_CWD=$INIT_CWD\\\"", "release": "release-it", "example": "yarn --cwd example", - "bootstrap": "yarn config set agora-electron-sdk-pre-built 0 && yarn example && yarn install && yarn patch-package && yarn ts_interface_builder && yarn totalBuild && yarn link && yarn example link agora-electron-sdk && yarn config delete agora-electron-sdk-pre-built", - "ts_interface_builder": "ts-interface-builder ts/Private/*.ts -o ts/Private/ti/" + "bootstrap": "yarn config set agora-electron-sdk-pre-built 0 && yarn example && yarn install && yarn patch-package && yarn build:ts-interface && yarn totalBuild && yarn link && yarn example link agora-electron-sdk && yarn config delete agora-electron-sdk-pre-built", + "build:ts-interface": "ts-interface-builder ts/Private/*.ts -o ts/Private/ti/" }, "keywords": [ "electron", @@ -135,7 +135,7 @@ "yuv-canvas": "1.2.6" }, "agora_electron": { - "iris_sdk_win": "https://download.agora.io/sdk/release/iris_4.2.3-build.4_DCG_Windows_Video_20231019_0355.zip", - "iris_sdk_mac": "https://download.agora.io/sdk/release/iris_4.2.3-build.4_DCG_Mac_Video_20231019_0355.zip" + "iris_sdk_win": "https://download.agora.io/sdk/release/iris_4.2.6-build.2_DCG_Windows_Video_20231109_1040.zip", + "iris_sdk_mac": "https://download.agora.io/sdk/release/iris_4.2.6-build.2_DCG_Mac_Video_20231109_1040.zip" } }