Build API Example / Addon #715
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
name: Build API Example / Addon | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
workflow_call: | |
inputs: | |
type: | |
description: 'Build type' | |
required: true | |
default: 'sdk' | |
type: string | |
workflow_dispatch: | |
inputs: | |
type: | |
description: 'Build type' | |
required: true | |
default: 'demo' | |
type: choice | |
options: | |
- demo | |
- 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: | | |
curl -X POST -sS -D- -o/dev/null ${{secrets.JENKINS_BUILD_URL}} \ | |
-H 'Content-Type: application/json' \ | |
-d "{\"branch\": \"${{github.ref_name}}\", \"type\": \"sdk\"}" | |
build-windows: | |
if: ${{ inputs.type == 'demo' || contains(github.event.pull_request.labels.*.name, 'ci:dep-update') }} | |
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@v4 | |
- name: Setup | |
uses: ./.github/actions/setup | |
with: | |
skip_install: true | |
- name: Prepare Build Example | |
run: | | |
yarn | |
- name: Build Example | |
run: | | |
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 | |
if-no-files-found: error | |
build-mac: | |
if: ${{ inputs.type == 'demo' || contains(github.event.pull_request.labels.*.name, 'ci:dep-update') }} | |
strategy: | |
matrix: | |
arch: [arm64, x64] | |
runs-on: macos-latest | |
env: | |
npm_config_arch: ${{ matrix.arch }} | |
npm_config_agora_electron_arch: ${{ matrix.arch }} | |
npm_config_agora_electron_sdk_arch: ${{ matrix.arch }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup | |
uses: ./.github/actions/setup | |
with: | |
skip_install: true | |
- name: Prepare Build Example | |
run: | | |
yarn | |
env: | |
USE_HARD_LINKS: false | |
- name: Build Example | |
run: | | |
node scripts/build-example-prepare.js | |
yarn dist:mac | |
working-directory: example | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: AgoraRtcNgExample-mac-${{ matrix.arch }} | |
path: | | |
example/dist/Agora-Electron-API-Example-*-mac.zip | |
if-no-files-found: error | |
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 }}\nDownload Link:\nhttps://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}"}}' |