Skip to content

Build API Example / Addon #717

Build API Example / Addon

Build API Example / Addon #717

Workflow file for this run

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
- 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 }}
yarn unlink agora-electron-sdk
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') }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- 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
yarn unlink agora-electron-sdk
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
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 }}"}}'