Skip to content

Commit c97e624

Browse files
Update OpusCompile.yml
1 parent 0035558 commit c97e624

File tree

1 file changed

+25
-111
lines changed

1 file changed

+25
-111
lines changed

.github/workflows/OpusCompile.yml

Lines changed: 25 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -67,119 +67,33 @@ jobs:
6767
name: android-${{ matrix.arch }}-libopus.so
6868
path: ./build/libopus.so
6969

70-
Linux_Build_x64:
71-
if: false
72-
runs-on: ubuntu-latest
73-
steps:
74-
- uses: actions/checkout@v4
75-
76-
- name: Clone Repository
77-
run: git clone https://github.com/xiph/opus.git
78-
79-
- name: Autogen
80-
run: ./opus/autogen.sh
81-
82-
- name: Create Build Dir
83-
run: mkdir build
84-
85-
- name: Configure
86-
working-directory: ./build
87-
run: cmake ../opus -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DOPUS_BUILD_PROGRAMS=ON
88-
89-
- name: Build
90-
working-directory: ./build
91-
run: cmake --build . -j 2 --config Release --target package
92-
93-
- name: Rename file
94-
working-directory: ./build
95-
run: mv libopus.so.0.10.1 opus.so
96-
97-
- name: Upload Artifact
98-
uses: actions/upload-artifact@v4
99-
with:
100-
name: linux-x86_64-opus.so
101-
path: ./build/opus.so
102-
103-
Linux_Build_x32:
104-
if: false
105-
runs-on: ubuntu-latest
106-
steps:
107-
- uses: actions/checkout@v4
108-
109-
- name: Setup Build Libraries
110-
run: sudo apt-get install g++-multilib
111-
112-
- name: Clone Repository
113-
run: git clone https://github.com/xiph/opus.git
114-
115-
- name: Autogen
116-
run: ./opus/autogen.sh
117-
118-
- name: Create Build Dir
119-
run: mkdir build
120-
121-
- name: Configure
122-
working-directory: ./build
123-
run: cmake ../opus -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DOPUS_BUILD_PROGRAMS=ON -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32
124-
125-
- name: Build
126-
working-directory: ./build
127-
run: cmake --build . -j 2 --config Release --target package
128-
129-
- name: Rename file
130-
working-directory: ./build
131-
run: mv libopus.so.0.10.1 opus.so
132-
133-
- name: Upload Artifact
134-
uses: actions/upload-artifact@v4
135-
with:
136-
name: linux-x86-opus.so
137-
path: ./build/opus.so
138-
139-
Linux_Build_Arm64:
140-
if: false
141-
runs-on: ubuntu-latest
142-
steps:
143-
- uses: actions/checkout@v4
144-
145-
- name: Setup Build Libraries
146-
run: sudo apt-get install g++-aarch64-linux-gnu
147-
148-
- name: Clone Repository
149-
run: git clone https://github.com/xiph/opus.git
150-
151-
- name: Autogen
152-
run: ./opus/autogen.sh
153-
154-
- name: Create Build Dir
155-
run: mkdir build
156-
157-
- name: Configure
158-
working-directory: ./build
159-
run: cmake ../opus -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DOPUS_BUILD_PROGRAMS=ON -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++
160-
161-
- name: Build
162-
working-directory: ./build
163-
run: cmake --build . -j 2 --config Release --target package
164-
165-
- name: Rename file
166-
working-directory: ./build
167-
run: mv libopus.so.0.10.1 opus.so
168-
169-
- name: Upload Artifact
170-
uses: actions/upload-artifact@v4
171-
with:
172-
name: linux-arm64-opus.so
173-
path: ./build/opus.so
174-
175-
Linux_Build_Arm32:
176-
if: false
70+
Linux:
17771
runs-on: ubuntu-latest
72+
strategy:
73+
matrix:
74+
arch: [x64, x86, arm64, arm32]
17875
steps:
17976
- uses: actions/checkout@v4
18077

181-
- name: Setup Build Libraries
182-
run: sudo apt-get install g++-arm-linux-gnueabi
78+
# Not much I can do to reduce the bloat.
79+
- name: Setup Environment
80+
run: |
81+
if [[ "${{ matrix.arch }}" == "x64" ]]; then
82+
echo "C_COMPILER=-m64" >> $GITHUB_ENV
83+
echo "CXX_COMPILER=-m64" >> $GITHUB_ENV
84+
elif [[ "${{ matrix.arch }}" == "x86" ]]; then
85+
sudo apt-get install g++-multilib
86+
echo "C_COMPILER=-m32" >> $GITHUB_ENV
87+
echo "CXX_COMPILER=-m32" >> $GITHUB_ENV
88+
elif [[ "${{ matrix.arch }}" == "arm64" ]]; then
89+
sudo apt-get install g++-aarch64-linux-gnu
90+
echo "C_COMPILER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
91+
echo "CXX_COMPILER=aarch64-linux-gnu-g++" >> $GITHUB_ENV
92+
elif [[ "${{ matrix.arch }}" == "arm32" ]]; then
93+
sudo apt-get install g++-arm-linux-gnueabi
94+
echo "C_COMPILER=arm-linux-gnueabi-gcc" >> $GITHUB_ENV
95+
echo "CXX_COMPILER=arm-linux-gnueabi-g++" >> $GITHUB_ENV
96+
fi
18397
18498
- name: Clone Repository
18599
run: git clone https://github.com/xiph/opus.git
@@ -192,7 +106,7 @@ jobs:
192106

193107
- name: Configure
194108
working-directory: ./build
195-
run: cmake ../opus -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DOPUS_BUILD_PROGRAMS=ON -DCMAKE_C_COMPILER=arm-linux-gnueabi-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabi-g++
109+
run: cmake ../opus -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DOPUS_BUILD_PROGRAMS=ON -DCMAKE_C_FLAGS=${{ env.C_COMPILER }} -DCMAKE_CXX_FLAGS=${{ env.CXX_COMPILER }}
196110

197111
- name: Build
198112
working-directory: ./build
@@ -205,7 +119,7 @@ jobs:
205119
- name: Upload Artifact
206120
uses: actions/upload-artifact@v4
207121
with:
208-
name: linux-arm32-opus.so
122+
name: linux-${{ matrix.arch }}-opus.so
209123
path: ./build/opus.so
210124

211125
Win_Build_x64:

0 commit comments

Comments
 (0)