-
Notifications
You must be signed in to change notification settings - Fork 3
122 lines (118 loc) · 4.25 KB
/
opus.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
name: Update Opus
on:
release:
types:
- published
workflow_dispatch:
push:
branches:
- master
paths:
- '.github/workflows/opus.yml'
permissions:
contents: write
jobs:
build-linux:
name: Build Opus for Linux x64
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Checkout Opus
run: git clone https://gitlab.xiph.org/xiph/opus libs/opus
- name: Get Opus latest version
run: "cd libs/opus && echo \"OPUS_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))\" >> $GITHUB_ENV"
- name: Build on Linux
run: |
cd libs/opus
git checkout ${{ env.OPUS_VERSION }}
sudo apt-get update
sudo apt-get -y install autoconf automake libtool gcc make git
./autogen.sh
./configure CFLAGS='-O2' CXXFLAGS='-O2'
make -j`nproc`
REAL_FILE=$(readlink -f .libs/libopus.so)
mkdir -p "${{ github.workspace }}/libs/libopus/"
mv "$REAL_FILE" "${{ github.workspace }}/libs/libopus/libopus.so"
- name: "Commit Opus"
uses: EndBug/add-and-commit@v9
with:
add: "libs/libopus/"
default_author: github_actions
message: Update libopus.so to ${{ env.OPUS_VERSION }}
pull: '--rebase --autostash'
push: true
build-macos:
name: Build Opus for MacOS x64
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Checkout Opus
run: git clone https://gitlab.xiph.org/xiph/opus libs/opus
- name: Get Opus latest version
run: "cd libs/opus && echo \"OPUS_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))\" >> $GITHUB_ENV"
- name: Build for MacOS x64
run: |
cd libs/opus
git checkout ${{ env.OPUS_VERSION }}
brew install autoconf automake libtool git
./autogen.sh
./configure CFLAGS='-O2' CXXFLAGS='-O2'
make -j`nproc`
REAL_FILE=$(readlink -f .libs/libopus.dylib)
mv "$REAL_FILE" "${{ github.workspace }}/libs/libopus/libopus.dylib"
# I'm unable to build Sodium for MacOS Arm, so I'm disabling this for now
#- name: Build for MacOS Arm
# run: |
# cd libs/opus
# git clean -fdx
# ./autogen.sh
# ./configure --host=arm-apple-darwin20 --target=arm-apple-darwin20 CFLAGS='-O2' CXXFLAGS='-O2'
# make -j`nproc`
# REAL_FILE=$(readlink -f .libs/libopus.dylib)
# mv "$REAL_FILE" "${{ github.workspace }}/libs/libopus/libopus-arm64.dylib"
- name: "Commit Opus"
uses: EndBug/add-and-commit@v9
with:
add: "libs/libopus/"
default_author: github_actions
message: Update libopus.dylib to ${{ env.OPUS_VERSION }}
pull: '--rebase --autostash'
push: true
build-windows:
name: Build Opus for Windows x64
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up MSBuild
uses: microsoft/[email protected]
with:
msbuild-architecture: x64
- name: Checkout Opus
run: git clone https://gitlab.xiph.org/xiph/opus libs/opus
- name: Get Opus latest version
run: "cd libs/opus && echo \"OPUS_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))\" | Out-File -Append $env:GITHUB_ENV"
- name: Build on Windows
run: |
cd libs/opus
git checkout ${{ env.OPUS_VERSION }}
cd win32/VS2015
msbuild opus.sln /property:Configuration="ReleaseDLL" /p:Platform="x64" /p:PlatformToolset=v143 /p:Optimization=2 /m
rm "${{ github.workspace }}/libs/libopus/opus.dll"
mv x64/ReleaseDLL/opus.dll "${{ github.workspace }}/libs/libopus/opus.dll"
- name: "Commit Opus"
uses: EndBug/add-and-commit@v9
with:
add: "libs/libopus/"
default_author: github_actions
message: Update opus.dll to ${{ env.OPUS_VERSION }}
pull: '--rebase --autostash'
push: true