From 060bb1cfe6ef1ae9eada8d0e65a22b3aeee23752 Mon Sep 17 00:00:00 2001 From: Arthas <15215604969@163.com> Date: Fri, 22 Sep 2023 22:59:37 +0800 Subject: [PATCH] feat: support 4.2.2.136 (#1075) * feat: support 4.2.2.136 * [WIP] --- .github/workflows/build.yml | 76 ++++++++++++++++++++++- README.md | 4 +- ci/electron-sdk-build-mac-release.sh | 6 +- ci/electron-sdk-build-windows-release.bat | 8 +-- ci/packager-mac.sh | 4 +- example/package.json | 37 ++++++----- package.json | 6 +- 7 files changed, 109 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 799aa11eb..df3fab441 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ on: types: [ published ] jobs: - build: + build-jenkins: runs-on: ubuntu-latest steps: - name: Build @@ -32,3 +32,77 @@ jobs: curl -X POST -sS -D- -o/dev/null ${{secrets.JENKINS_BUILD_URL}} \ -H 'Content-Type: application/json' \ -d "{\"branch\": \"${{github.ref_name}}\", \"type\": \"${type}\"}" + + build-windows: + if: ${{ inputs.type == 'demo' }} + strategy: + matrix: + arch: [ ia32, x64 ] + runs-on: windows-latest + env: + npm_config_arch: ${{ matrix.arch }} + npm_config_agora_electron_arch: ${{ matrix.arch }} + npm_config_agora_electron_sdk_arch: ${{ matrix.arch }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup + + - name: Build SDK + run: | + yarn totalBuild + yarn zipBuild + yarn link + + - name: Build Example + run: | + yarn install + yarn link agora-electron-sdk + yarn dist:win --${{ matrix.arch }} + working-directory: example + + - uses: actions/upload-artifact@v3 + with: + name: AgoraRtcNgExample-win-${{ matrix.arch }} + path: | + example/dist/Agora-Electron-API-Example-*-win.zip + + + build-mac: + if: ${{ inputs.type == 'demo' }} + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup + + - name: Build SDK + run: | + yarn totalBuild + yarn zipBuild + yarn link + + - name: Build Example + run: | + yarn install + yarn link agora-electron-sdk + yarn dist:mac + env: + USE_HARD_LINKS: false + working-directory: example + + - uses: actions/upload-artifact@v3 + with: + name: AgoraRtcNgExample-mac + path: | + example/dist/Agora-Electron-API-Example-*-mac.zip + + notification: + runs-on: ubuntu-latest + needs: [ build-windows, build-mac ] + steps: + - run: | + curl -X POST "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${{ secrets.WECHAT_KEY }}" -d '{"msgtype":"text","text":{"content":"Electron Example:\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}}' diff --git a/README.md b/README.md index 9965538b5..844b4704e 100644 --- a/README.md +++ b/README.md @@ -126,10 +126,10 @@ $ npm install #or yarn $ npm install --agora_electron_sdk_pre_built=false # build 32 bit architecture on Windows -$ npm install --verbose --agora_electron_sdk_pre_built=false --agora_electron_sdk_arch=ia32 +$ npm install --agora_electron_sdk_pre_built=false --agora_electron_sdk_arch=ia32 # build 64 bit architecture on Windows -$ npm install --verbose --agora_electron_sdk_pre_built=false --agora_electron_sdk_arch=x64 +$ npm install --agora_electron_sdk_pre_built=false --agora_electron_sdk_arch=x64 ``` ## 🤝 Contributing [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/AgoraIO-Extensions/Electron-SDK/pulls) diff --git a/ci/electron-sdk-build-mac-release.sh b/ci/electron-sdk-build-mac-release.sh index e754683a9..d8743ca36 100755 --- a/ci/electron-sdk-build-mac-release.sh +++ b/ci/electron-sdk-build-mac-release.sh @@ -8,12 +8,12 @@ npm config set ELECTRON_MIRROR http://npm.taobao.org/mirrors/electron/ rm -rf node_modules rm -rf sdk rm -rf tmp -# npm install --verbose +# npm install # # Example 2 npm config set agora_electron_sdk_pre_built false -npm install --verbose -npm run totalBuild --verbose +npm install +npm run totalBuild npm run zipBuild npm config delete agora_electron_sdk_pre_built # diff --git a/ci/electron-sdk-build-windows-release.bat b/ci/electron-sdk-build-windows-release.bat index bda0b7a59..c16d9d52e 100644 --- a/ci/electron-sdk-build-windows-release.bat +++ b/ci/electron-sdk-build-windows-release.bat @@ -6,13 +6,13 @@ call npm config list call npm config set agora_electron_sdk_pre_built false if %1 == ia32 ( echo sdk_ia32 - call npm install --verbose --agora_electron_sdk_arch=ia32 - call npm run totalBuild --verbose --agora_electron_sdk_arch=ia32 + call npm install --agora_electron_sdk_arch=ia32 + call npm run totalBuild --agora_electron_sdk_arch=ia32 ) if %1 == x64 ( echo sdk_x64 - call npm install --verbose --agora_electron_sdk_arch=x64 - call npm run totalBuild --verbose --agora_electron_sdk_arch=x64 + call npm install --agora_electron_sdk_arch=x64 + call npm run totalBuild --agora_electron_sdk_arch=x64 ) call npm config delete agora_electron_sdk_pre_built diff --git a/ci/packager-mac.sh b/ci/packager-mac.sh index ccb16a13d..8588bc5b1 100755 --- a/ci/packager-mac.sh +++ b/ci/packager-mac.sh @@ -41,9 +41,7 @@ packExample() { export USE_HARD_LINKS=false yarn dist:mac - pushd dist/mac - zip -ry $(pwd)/../../../${outterZipName} Agora-Electron-API-Example.app - popd + cp -f dist/Agora-Electron-API-Example-*.zip ../${outterZipName} popd } diff --git a/example/package.json b/example/package.json index 451e917b6..0efc33f45 100644 --- a/example/package.json +++ b/example/package.json @@ -7,30 +7,35 @@ "start": "electron-webpack dev", "compile": "electron-webpack", "rebuild": "electron-rebuild -f -o ref-napi", - "dist": "yarn compile && electron-builder", - "dist:mac": "yarn dist --dir -c.compression=store -c.mac.identity=null", - "dist:win32": "yarn compile && electron-builder --publish never --win --ia32", - "dist:win64": "yarn compile && electron-builder --publish never --win --x64", - "switchEnv:win32": "cd .. && @powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./ci/packager-win.ps1 1 switchEnv", - "switchEnv:win64": "cd .. && @powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./ci/packager-win.ps1 2 switchEnv" + "dist": "npm run compile && electron-builder", + "dist:mac": "npm run dist -- --mac", + "dist:win": "npm run dist -- --win", + "dist:win32": "npm run dist:win -- --ia32", + "dist:win64": "npm run dist:win -- --x64" }, "build": { - "asar": false, + "appId": "agora.io.ElectronApiExample", + "asar": true, + "asarUnpack": [ + "node_modules/agora-electron-sdk" + ], "buildDependenciesFromSource": true, + "compression": "normal", "productName": "Agora-Electron-API-Example", - "appId": "agora.io.ElectronApiExample", + "publish": [], "files": [ "!*.log" ], "mac": { - "target": [ - "dir" - ], - "type": "distribution", - "hardenedRuntime": true, "entitlements": "assets/entitlements.mac.plist", "entitlementsInherit": "assets/entitlements.mac.plist", - "gatekeeperAssess": false + "gatekeeperAssess": false, + "hardenedRuntime": true, + "identity": null, + "target": [ + "zip" + ], + "type": "distribution" }, "dmg": { "contents": [ @@ -52,10 +57,10 @@ ] }, "linux": { + "category": "Development", "target": [ "AppImage" - ], - "category": "Development" + ] }, "directories": { "buildResources": "assets" diff --git a/package.json b/package.json index 9700322da..461fabf81 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "agora-electron-sdk", - "version": "4.2.2-build.134-rc.1", + "version": "4.2.2-build.136-rc.1", "description": "agora-electron-sdk", "main": "js/AgoraSdk", "types": "types/AgoraSdk.d.ts", @@ -134,7 +134,7 @@ "yuv-canvas": "1.2.6" }, "agora_electron": { - "iris_sdk_win": "https://download.agora.io/sdk/release/iris_4.2.2.134-build.1_DCG_Windows_Video_20230907_0345.zip", - "iris_sdk_mac": "https://download.agora.io/sdk/release/iris_4.2.2.134-build.1_DCG_Mac_Video_20230907_0345.zip" + "iris_sdk_win": "https://download.agora.io/sdk/release/iris_4.2.2.136-build.1_DCG_Windows_Video_20230922_0351.zip", + "iris_sdk_mac": "https://download.agora.io/sdk/release/iris_4.2.2.136-build.1_DCG_Mac_Video_20230922_0351.zip" } }