Skip to content

Update RNNoise

Update RNNoise #7

name: Update RNNoise
on:
schedule:
- cron: '0 6 * * 1' # every Monday at 06:00 UTC
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
check-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Get current bundled commit
id: current
run: |
if [ -f third_party/rnnoise/COMMIT ]; then
echo "sha=$(cat third_party/rnnoise/COMMIT)" >> $GITHUB_OUTPUT
else
echo "sha=unknown" >> $GITHUB_OUTPUT
fi
- name: Get latest upstream commit
id: upstream
run: |
LATEST=$(git ls-remote https://github.com/xiph/rnnoise.git refs/heads/main | cut -f1)
echo "sha=$LATEST" >> $GITHUB_OUTPUT
- name: Check if update needed
id: check
run: |
if [ "${{ steps.current.outputs.sha }}" = "${{ steps.upstream.outputs.sha }}" ]; then
echo "skip=true" >> $GITHUB_OUTPUT
echo "RNNoise is up to date (${{ steps.current.outputs.sha }})"
else
echo "skip=false" >> $GITHUB_OUTPUT
echo "Update available: ${{ steps.current.outputs.sha }} → ${{ steps.upstream.outputs.sha }}"
fi
- name: Install build dependencies
if: steps.check.outputs.skip == 'false'
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake libtool
- name: Clone and build RNNoise
if: steps.check.outputs.skip == 'false'
run: |
git clone https://github.com/xiph/rnnoise.git /tmp/rnnoise
cd /tmp/rnnoise
./autogen.sh
./configure
make -j$(nproc)
- name: Bundle updated sources
if: steps.check.outputs.skip == 'false'
run: |
# Clean old sources
rm -rf third_party/rnnoise/src third_party/rnnoise/include
mkdir -p third_party/rnnoise/{src,include,src/x86}
# Copy include
cp /tmp/rnnoise/include/rnnoise.h third_party/rnnoise/include/
# Copy source files
for f in _kiss_fft_guts.h arch.h celt_lpc.c celt_lpc.h common.h cpu_support.h \
denoise.c denoise.h kiss_fft.c kiss_fft.h nnet.c nnet.h nnet_arch.h \
nnet_default.c opus_types.h parse_lpcnet_weights.c pitch.c pitch.h \
rnn.c rnn.h rnnoise_data.c rnnoise_data.h rnnoise_tables.c \
vec.h vec_avx.h vec_neon.h; do
cp /tmp/rnnoise/src/$f third_party/rnnoise/src/ 2>/dev/null || true
done
# Copy x86 SIMD files
for f in dnn_x86.h nnet_avx2.c nnet_sse4_1.c x86_arch_macros.h \
x86_dnn_map.c x86cpu.c x86cpu.h; do
cp /tmp/rnnoise/src/x86/$f third_party/rnnoise/src/x86/ 2>/dev/null || true
done
# Copy license
cp /tmp/rnnoise/COPYING third_party/rnnoise/
# Record commit SHA
echo "${{ steps.upstream.outputs.sha }}" > third_party/rnnoise/COMMIT
- name: Create pull request
if: steps.check.outputs.skip == 'false'
uses: peter-evans/create-pull-request@v8
with:
commit-message: "Update bundled RNNoise to ${{ steps.upstream.outputs.sha }}"
title: "Update bundled RNNoise"
body: |
Automated update of bundled RNNoise (Mozilla/Xiph) sources.
**Previous commit:** `${{ steps.current.outputs.sha }}`
**New commit:** [`${{ steps.upstream.outputs.sha }}`](https://github.com/xiph/rnnoise/commit/${{ steps.upstream.outputs.sha }})
[Full changelog](https://github.com/xiph/rnnoise/compare/${{ steps.current.outputs.sha }}...${{ steps.upstream.outputs.sha }})
Please test RN2 audio quality before merging.
branch: update-rnnoise
delete-branch: true
labels: dependencies