-
Notifications
You must be signed in to change notification settings - Fork 3
188 lines (186 loc) · 7.05 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
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: Update Opus
on:
workflow_dispatch:
push:
branches:
- master
paths:
- '.github/workflows/opus.yml'
- '.github/scripts/package-opus.sh'
permissions:
contents: write
jobs:
build:
name: Build Opus for ${{ matrix.config.rid }}
runs-on: ${{ matrix.config.os }}
outputs:
version: ${{ steps.build.outputs.version }}
strategy:
fail-fast: false
matrix:
config:
- {
os: ubuntu-latest,
install-deps: "sudo apt-get update && sudo apt-get -y install autoconf automake libtool gcc cmake make",
args: "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk/25.2.9519653/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a",
find-file: "libopus.so",
file: "libopus.so",
rid: "android-arm64",
}
- {
os: ubuntu-latest,
install-deps: "sudo apt-get update && sudo apt-get -y install autoconf automake libtool gcc cmake make",
args: "",
find-file: "libopus.so.*.*.*",
file: "libopus.so",
rid: "linux-x64"
}
- {
os: ubuntu-latest,
install-deps: "sudo apt-get update && sudo apt-get -y install autoconf automake libtool cmake make \
&& wget https://musl.cc/x86_64-linux-musl-cross.tgz \
&& tar xzf x86_64-linux-musl-cross.tgz \
&& export PATH=\\\"$(pwd)/x86_64-linux-musl-cross/bin:$PATH\\\" \
&& export CC=x86_64-linux-musl-gcc \
&& alias gcc=x86_64-linux-musl-gcc",
args: "",
find-file: "libopus.so.*.*.*",
file: "libopus.so",
rid: "linux-musl-x64"
}
- {
os: ubuntu-latest,
install-deps: "sudo apt-get update && sudo apt-get -y install autoconf automake libtool gcc-arm-linux-gnueabi binutils-arm-linux-gnueabi cmake make \
&& export CC=arm-linux-gnueabi-gcc make \
&& alias gcc=arm-linux-gnueabi-gcc",
args: "",
find-file: "libopus.so.*.*.*",
file: "libopus.so",
rid: "linux-arm64"
}
- {
os: ubuntu-latest,
install-deps: "sudo apt-get update && sudo apt-get -y install autoconf automake libtool cmake make \
&& wget https://musl.cc/aarch64-linux-musl-cross.tgz \
&& tar xzf aarch64-linux-musl-cross.tgz \
&& export PATH=\\\"$(pwd)/aarch64-linux-musl-cross/bin:$PATH\\\" \
&& export CC=aarch64-linux-musl-gcc \
&& alias gcc=aarch64-linux-musl-gcc",
args: "",
find-file: "libopus.so.*.*.*",
file: "libopus.so",
rid: "linux-musl-arm64"
}
- {
os: macos-latest,
install-deps: "brew install autoconf automake libtool gcc cmake make && export PATH=\\\"/usr/local/opt/make/libexec/gnubin:$PATH\\\"",
args: "",
find-file: "libopus.*.*.*.dylib",
file: "libopus.dylib",
rid: "osx-x64"
}
- {
os: macos-latest,
install-deps: "brew install autoconf automake libtool gcc cmake make && export PATH=\\\"/usr/local/opt/make/libexec/gnubin:$PATH\\\"",
args: "-DCMAKE_OSX_ARCHITECTURES=arm64",
find-file: "libopus.*.*.*.dylib",
file: "libopus.dylib",
rid: "osx-arm64"
}
- {
os: macos-latest,
install-deps: "brew install autoconf automake libtool gcc cmake make && export PATH=\\\"/usr/local/opt/make/libexec/gnubin:$PATH\\\"",
args: "-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64",
find-file: "libopus.*.*.*.dylib",
file: "libopus.dylib",
rid: "ios-arm64"
}
- {
os: windows-latest,
install-deps: "",
args: "-A Win32",
find-file: "Release/opus.dll",
file: "opus.dll",
rid: "win-x86",
arch: "x86"
}
- {
os: windows-latest,
install-deps: "",
args: "-A x64",
find-file: "Release/opus.dll",
file: "opus.dll",
rid: "win-x64",
arch: "x64"
}
- {
os: windows-latest,
install-deps: "",
args: "-A ARM64",
find-file: "Release/opus.dll",
file: "opus.dll",
rid: "win-arm64",
arch: "arm64"
}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up MSBuild
if: contains('win', matrix.config.rid)
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: ${{ matrix.config.arch }}
- name: Set up JDK 17
if: contains('android', matrix.config.rid)
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
if: contains('android', matrix.config.rid)
uses: android-actions/setup-android@v3
- name: Install dependencies
shell: bash
run: ${{ matrix.config.install-deps }}
- name: "Build ${{ matrix.config.file }}"
id: build
shell: bash
run: |
export WORKSPACE='${{ github.workspace }}'
export COMMAND_ARGS="${{ matrix.config.args }}"
export FIND_FILE='${{ matrix.config.find-file }}'
export FILE='${{ matrix.config.file }}'
export RID='${{ matrix.config.rid }}'
export JOB_INDEX='${{ strategy.job-index }}'
bash '${{ github.workspace }}/.github/scripts/package-opus.sh'
- name: "Update ${{ matrix.config.rid }}"
uses: EndBug/add-and-commit@v9
with:
add: "libs/libopus/"
default_author: github_actions
message: Update Opus ${{ matrix.config.rid }} to ${{ steps.build.outputs.version }}
pull: "--rebase --autostash"
push: true
update-version:
name: Update .NET project version
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update version
run: |
sed -i "s|<Version>.*</Version>|<Version>${{ needs.build.outputs.version }}</Version>|g" "${{ github.workspace }}/src/DSharpPlus.VoiceLink.Natives.Opus/DSharpPlus.VoiceLink.Natives.Opus.csproj"
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Push changes"
uses: EndBug/add-and-commit@v9
with:
add: "src/DSharpPlus.VoiceLink.Natives.Opus/DSharpPlus.VoiceLink.Natives.Opus.csproj"
default_author: github_actions
message: Update Opus version to ${{ needs.build.outputs.version }}
pull: "--rebase --autostash"
push: true