-
Notifications
You must be signed in to change notification settings - Fork 74
116 lines (102 loc) · 3.24 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
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 }}"}}'