forked from shiguredo-webrtc-build/webrtc-build
-
Notifications
You must be signed in to change notification settings - Fork 1
188 lines (186 loc) · 5.51 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: build
on:
push:
paths-ignore:
- '**.md'
- 'LICENSE'
- '.gitignore'
- '.dockerignore'
branches-ignore:
- daily
tags:
- '*'
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Disk Cleanup
run: |
Get-PSDrive
# Cache 済み Docker Image の削除
docker rmi $(docker images -q -a)
# Android SDK の削除
Remove-Item -Recurse -Force $Env:ANDROID_HOME -ErrorAction Ignore
Remove-Item -Recurse -Force $Env:ANDROID_NDK_HOME -ErrorAction Ignore
# JVM の削除
Remove-Item -Recurse -Force $Env:JAVA_HOME_11_X64 -ErrorAction Ignore
Remove-Item -Recurse -Force $Env:JAVA_HOME_8_X64 -ErrorAction Ignore
Get-PSDrive
- run: "& .\\build.windows.ps1"
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: webrtc.windows.zip
path: _package\windows\webrtc.zip
build-macos:
strategy:
fail-fast: false
matrix:
name:
- macos_arm64
- macos_x86_64
- ios
runs-on: macOS-11.0
steps:
- uses: actions/checkout@v2
- run: ./build.${{ matrix.name }}.sh
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: webrtc.${{ matrix.name }}.tar.gz
path: _package/${{ matrix.name }}/webrtc.tar.gz
build-linux:
strategy:
fail-fast: false
matrix:
name:
- raspberry-pi-os_armv6
- raspberry-pi-os_armv7
- raspberry-pi-os_armv8
- ubuntu-18.04_armv8
- ubuntu-18.04_x86_64
- ubuntu-20.04_x86_64
- android
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Disk Cleanup
run: |
df -h
docker rmi `docker images -q -a`
# 3.9GB
sudo rm -rf /usr/local/share/boost
# 17GB
sudo rm -rf /usr/share/dotnet
df -h
- run: ./build.${{ matrix.name }}.sh
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: webrtc.${{ matrix.name }}.tar.gz
path: _package/${{ matrix.name }}/webrtc.tar.gz
create-release:
name: Create Release
if: contains(github.ref, 'tags/m')
needs:
- build-windows
- build-macos
- build-linux
runs-on: ubuntu-18.04
steps:
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Output upload url
shell: bash
run: echo "UPLOAD_URL='${{ steps.create_release.outputs.upload_url }}'" > create-release.env
- name: Upload create-release Environment
uses: actions/upload-artifact@v1
with:
name: create-release.env
path: create-release.env
upload-assets:
strategy:
fail-fast: false
matrix:
name:
- macos_arm64
- macos_x86_64
- ios
- raspberry-pi-os_armv6
- raspberry-pi-os_armv7
- raspberry-pi-os_armv8
- ubuntu-18.04_armv8
- ubuntu-18.04_x86_64
- ubuntu-20.04_x86_64
- android
name: Release ${{ matrix.name }}
if: contains(github.ref, 'tags/m')
needs:
- create-release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download ${{ matrix.name }}
uses: actions/download-artifact@v1
with:
name: webrtc.${{ matrix.name }}.tar.gz
- uses: actions/download-artifact@v1
with:
name: create-release.env
- name: Env to output
shell: bash
run: |
source create-release.env/create-release.env
echo "::set-output name=upload_url::$UPLOAD_URL"
id: env
- name: Upload ${{ matrix.name }} Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
with:
upload_url: ${{ steps.env.outputs.upload_url }}
asset_path: webrtc.${{ matrix.name }}.tar.gz/webrtc.tar.gz
asset_name: webrtc.${{ matrix.name }}.tar.gz
asset_content_type: application/gzip
# Windows だけ Content-Type が違うので別で記述する
upload-assets-windows:
name: Upload windows
if: contains(github.ref, 'tags/m')
needs:
- create-release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download windows
uses: actions/download-artifact@v1
with:
name: webrtc.windows.zip
- uses: actions/download-artifact@v1
with:
name: create-release.env
- name: Env to output
shell: bash
run: |
source create-release.env/create-release.env
echo "::set-output name=upload_url::$UPLOAD_URL"
id: env
- name: Upload windows Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
with:
upload_url: ${{ steps.env.outputs.upload_url }}
asset_path: webrtc.windows.zip/webrtc.zip
asset_name: webrtc.windows.zip
asset_content_type: application/zip