forked from crow-misia/libwebrtc-bin
-
Notifications
You must be signed in to change notification settings - Fork 2
125 lines (106 loc) · 3.6 KB
/
ci.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
name: CI
on:
push:
branches: ["main"]
tags: ["*"]
pull_request:
branches: ["main"]
paths-ignore: ["**.md"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
############
# Building #
############
build:
strategy:
fail-fast: false
matrix:
include:
- os: android
- os: ios
- os: linux
arch: arm64
- os: linux
arch: x64
- os: macos
arch: arm64
- os: macos
arch: x64
- os: windows
arch: x64
runs-on: ${{ ((matrix.os == 'ios' || matrix.os == 'macos') && 'macos-11')
|| (matrix.os == 'windows' && 'windows-2019')
|| 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v3
- run: ./disk_cleanup.sh
if: ${{ matrix.os == 'android' || matrix.os == 'linux' }}
- run: powershell .\disk_cleanup.bat
if: ${{ matrix.os == 'windows' }}
- run: make -C docker ${{ matrix.os }}${{ matrix.arch != '' && format('-{0}', matrix.arch) || '' }}
if: ${{ matrix.os == 'android' || matrix.os == 'linux' }}
- run: make -C build USE_CCACHE=0 ${{ matrix.os }}${{ matrix.arch != '' && format('-{0}', matrix.arch) || '' }}
if: ${{ matrix.os == 'ios' || matrix.os == 'macos' }}
- run: powershell .\build.windows.bat
if: ${{ matrix.os == 'windows' }}
- uses: actions/upload-artifact@v3
with:
name: build
path: package/libwebrtc-${{ matrix.os }}${{ matrix.arch != '' && format('-{0}', matrix.arch) || '' }}.${{ (matrix.os == 'ios' && 'zip') || 'tar.gz' }}
if-no-files-found: error
#############
# Releasing #
#############
publish-cocoapods:
name: publish (CocoaPods)
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: ["release-github"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-cocoapods@v1
with:
version: latest
- run: pod spec lint --allow-warnings --verbose
- run: pod trunk push --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
release-github:
name: release (GitHub)
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: ["build"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Parse release version
id: release
run: echo "version=${GITHUB_REF#refs/tags/}"
>> $GITHUB_OUTPUT
- name: Verify release version matches VERSION file
run: |
test "${{ steps.release.outputs.version }}" \
== "$(grep 'WEBRTC_VERSION=' VERSION | cut -d '=' -f2 | tr -d '\n')"
if: ${{ !contains(steps.release.outputs.version, '-') }}
- uses: actions/download-artifact@v3
with:
name: build
path: package/
- name: Generate SHA256 checksums
run: ls -1 | xargs -I {} sh -c "sha256sum {} > {}.sha256sum"
working-directory: package/
- name: Show generated SHA256 checksums
run: cat *.sha256sum
working-directory: package/
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.release.outputs.version }}
files: |
package/libwebrtc-*.tar.gz
package/libwebrtc-*.tar.gz.sha256sum
package/libwebrtc-*.zip
package/libwebrtc-*.zip.sha256sum
fail_on_unmatched_files: true
prerelease: ${{ contains(steps.release.outputs.version, '-') }}