Update Opus #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |