diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml
new file mode 100644
index 00000000..abaeb602
--- /dev/null
+++ b/.github/actions/build/action.yml
@@ -0,0 +1,62 @@
+name: 'Maven Build'
+
+description: 'Build the platform dependent Java library'
+
+inputs:
+ java-version:
+ description: 'The Java build version.'
+ required: true
+ default: '17'
+
+ platform-name:
+ description: 'The target platform.'
+ required: true
+
+ maven-username:
+ description: 'The Maven username.'
+ required: true
+
+ maven-password:
+ description: 'The Maven password.'
+ required: true
+
+runs:
+ using: "composite"
+ steps:
+ - name: Set up WebRTC cache
+ uses: actions/cache@v4
+ with:
+ path: ~/${{ env.WEBRTC_INSTALL_FOLDER }}
+ key: webrtc-${{ env.WEBRTC_CACHE_BRANCH }}-${{ inputs.platform-name }}-${{ hashFiles('webrtc-jni/pom.xml') }}
+ restore-keys: webrtc-${{ env.WEBRTC_CACHE_BRANCH }}-${{ inputs.platform-name }}-
+
+ - name: Set up Maven cache
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2/repository
+ key: maven-${{ inputs.platform-name }}-${{ hashFiles('**/pom.xml') }}
+ restore-keys: maven-${{ inputs.platform-name }}-
+
+ - name: Set up JDK ${{ inputs.java-version }}
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ inputs.java-version }}
+ distribution: 'temurin'
+ server-id: ossrh
+ server-username: MAVEN_USERNAME
+ server-password: MAVEN_TOKEN
+
+ - name: Build
+ run: mvn package -DskipTests
+ shell: bash
+
+ - name: Test
+ run: mvn -B jar:jar surefire:test
+ shell: bash
+
+ - name: Deploy
+ env:
+ MAVEN_USERNAME: ${{ inputs.maven-username }}
+ MAVEN_TOKEN: ${{ inputs.maven-password }}
+ run: mvn deploy -DskipTests
+ shell: bash
diff --git a/.github/maven-action/action.yml b/.github/actions/release/action.yml
similarity index 81%
rename from .github/maven-action/action.yml
rename to .github/actions/release/action.yml
index c8457abd..399ecb5f 100644
--- a/.github/maven-action/action.yml
+++ b/.github/actions/release/action.yml
@@ -1,6 +1,6 @@
-name: 'Maven Build'
+name: 'Maven Release'
-description: 'Build the platform dependent Java library'
+description: 'Release the platform dependent Java library'
inputs:
java-version:
@@ -12,11 +12,11 @@ inputs:
description: 'The target platform.'
required: true
- gpg-key:
+ maven-gpg-private-key:
description: 'The GPG private key to sign Maven artifacts.'
required: true
- gpg-pass:
+ maven-gpg-passphrase:
description: 'The GPG passphrase for the GPG key.'
required: true
@@ -53,10 +53,11 @@ runs:
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_TOKEN
- settings-path: ${{ github.workspace }}/.github/workflows
+ gpg-private-key: ${{ inputs.maven-gpg-private-key }}
+ gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build
- run: mvn package -DskipTests -s .github/workflows/settings.xml
+ run: mvn package -DskipTests
shell: bash
- name: Test
@@ -67,5 +68,6 @@ runs:
env:
MAVEN_USERNAME: ${{ inputs.maven-username }}
MAVEN_TOKEN: ${{ inputs.maven-password }}
- run: mvn deploy -DskipTests -s .github/workflows/settings.xml
+ MAVEN_GPG_PASSPHRASE: ${{ inputs.maven-gpg-passphrase }}
+ run: mvn deploy -Prelease -DskipTests
shell: bash
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 63f5063e..cde29762 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -68,12 +68,12 @@ jobs:
- id: maven-build
name: Maven build
- uses: ./.github/maven-action
+ uses: ./.github/actions/build
with:
java-version: ${{ matrix.java }}
platform-name: ${{ matrix.platform.name }}
maven-username: ${{ secrets.MAVEN_USERNAME }}
- maven-password: ${{ secrets.MAVEN_PASSWORD }}
+ maven-password: ${{ secrets.MAVEN_TOKEN }}
build-linux:
strategy:
@@ -122,12 +122,12 @@ jobs:
- id: maven-build
name: Maven build
- uses: ./.github/maven-action
+ uses: ./.github/actions/build
with:
java-version: ${{ matrix.java }}
platform-name: ${{ matrix.platform.name }}
maven-username: ${{ secrets.MAVEN_USERNAME }}
- maven-password: ${{ secrets.MAVEN_PASSWORD }}
+ maven-password: ${{ secrets.MAVEN_TOKEN }}
build-macos:
strategy:
@@ -153,13 +153,13 @@ jobs:
brew install python-setuptools
- name: Select Xcode version
- run: sudo xcode-select -s /Applications/Xcode_14.3.1.app/Contents/Developer
+ run: sudo xcode-select -s /Applications/Xcode_15.0.1.app/Contents/Developer
- id: maven-build
name: Maven build
- uses: ./.github/maven-action
+ uses: ./.github/actions/build
with:
java-version: ${{ matrix.java }}
platform-name: ${{ matrix.platform.name }}
maven-username: ${{ secrets.MAVEN_USERNAME }}
- maven-password: ${{ secrets.MAVEN_PASSWORD }}
+ maven-password: ${{ secrets.MAVEN_TOKEN }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index c80e8856..04005cba 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -5,78 +5,262 @@ on:
tags:
- 'v*'
workflow_dispatch:
+ inputs:
+ developmentVersion:
+ description: "Default version to use for new local working copy."
+ required: true
+ default: "X.Y.Z-SNAPSHOT"
+
+env:
+ WEBRTC_CACHE_BRANCH: 4844
+ WEBRTC_CHECKOUT_FOLDER: webrtc
+ WEBRTC_INSTALL_FOLDER: webrtc/build
jobs:
- release:
- runs-on: [self-hosted, "${{ matrix.os }}"]
+ prepare-release:
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Disk cleanup
+ run: |
+ set -x
+ df -h
+ #sudo du -h -d1 /usr/local
+ #sudo du -h -d1 /usr/local/share
+ #sudo du -h -d1 /usr/local/lib
+ #sudo du -h -d1 /usr/share
+ # 4.6G
+ sudo rm -rf /usr/local/.ghcup
+ # 1.7G
+ sudo rm -rf /usr/share/swift
+ # 1.4G
+ sudo rm -rf /usr/share/dotnet
+ # 13G
+ sudo rm -rf /usr/local/lib/android
+ df -h
+
+ - name: Install required packages
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y pulseaudio libpulse-dev libasound2-dev libdbus-1-dev libudev-dev libv4l-dev libx11-dev binutils cmake git locales lsb-release ninja-build pkg-config python3 python3-setuptools rsync unzip wget xz-utils
+ # Required for testing
+ pulseaudio --start
+ #sudo apt-get install -y pipewire pipewire-pulse gstreamer1.0-pipewire libspa-0.2-bluetooth libspa-0.2-jack pipewire-audio-client-libraries
+ #systemctl --user daemon-reload
+ #systemctl --user --now enable pipewire{,-pulse}.{socket,service}
+ - name: Set up Java
+ uses: actions/setup-java@v4
+ with:
+ java-version: '21'
+ distribution: 'temurin'
+ server-id: ossrh
+ server-username: MAVEN_USERNAME
+ server-password: MAVEN_TOKEN
+ gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
+ gpg-passphrase: MAVEN_GPG_PASSPHRASE
+
+ - name: Checkout code
+ uses: actions/checkout@v4
+ env:
+ MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
+ MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
+ MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
+ - run: |
+ git config --global user.name "${{ github.actor }}"
+ git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
+ mvn release:prepare -DskipTests -DpushChanges=false -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}
+ git push
+ git push --tags
+
+ build-windows:
+ needs: prepare-release
strategy:
+ fail-fast: false
matrix:
- os: [ubuntu-20.04, macos-13, windows-2022]
+ platform:
+ - name: windows_x86_64
+ runs-on: windows-2019
java: [17]
-
- env:
- WEBRTC_CACHE_BRANCH: 4844
- WEBRTC_CHECKOUT_FOLDER: webrtc
- WEBRTC_INSTALL_FOLDER: webrtc/build
-
+ runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Checkout code
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
+ with:
+ fetch-tags: true
- - name: Set up Linux audio system
- if: runner.os == 'Linux'
+ - name: Get tag from current branch
+ id: tag-selector
+ shell: bash
run: |
- sudo apt-get update
- sudo apt-get install -y pulseaudio libpulse-dev libasound2-dev libudev-dev libv4l-dev
- # Required for testing
- pulseaudio --start
+ git fetch -a
+ tag=$(git describe --tags `git rev-list --tags --max-count=1`)
+ echo "tag=$tag" >> "$GITHUB_OUTPUT"
+ git checkout $tag
- - name: Set up WebRTC cache
- uses: actions/cache@v1
+ - name: Set up Python 3.11
+ if: false
+ uses: actions/setup-python@v5
with:
- path: ~/${{ env.WEBRTC_INSTALL_FOLDER }}
- key: webrtc-${{ env.WEBRTC_CACHE_BRANCH }}-${{ runner.os }}-${{ hashFiles('webrtc-jni/pom.xml') }}
- restore-keys: webrtc-${{ env.WEBRTC_CACHE_BRANCH }}-${{ runner.os }}-
+ python-version: "3.11"
- - name: Set up Maven cache
- uses: actions/cache@v1
- with:
- path: ~/.m2/repository
- key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
- restore-keys: maven-${{ runner.os }}-
+ - name: Disk cleanup
+ if: false
+ run: |
+ Get-PSDrive
+ # Docker Images
+ docker rmi $(docker images -q -a)
+ # Android SDK
+ if ($Env:ANDROID_HOME) {
+ Remove-Item -Recurse -Force $Env:ANDROID_HOME -ErrorAction Ignore
+ }
+ if ($Env:ANDROID_NDK_HOME) {
+ Remove-Item -Recurse -Force $Env:ANDROID_NDK_HOME -ErrorAction Ignore
+ }
+ # JVM
+ if ($Env:JAVA_HOME_11_X64) {
+ Remove-Item -Recurse -Force $Env:JAVA_HOME_11_X64 -ErrorAction Ignore
+ }
+ if ($Env:JAVA_HOME_8_X64) {
+ Remove-Item -Recurse -Force $Env:JAVA_HOME_8_X64 -ErrorAction Ignore
+ }
+ Get-PSDrive
- - name: Set up JDK ${{ matrix.java }}
- uses: actions/setup-java@v1
+ - name: Install required packages
+ run: |
+ choco install ninja
+
+ - id: maven-build
+ name: Maven build
+ uses: ./.github/actions/release
with:
java-version: ${{ matrix.java }}
- server-id: ossrh
- server-username: NEXUS_USERNAME
- server-password: NEXUS_PASSWORD
- settings-path: ${{ github.workspace }}/.github/workflows
- gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
- gpg-passphrase: GPG_PASSPHRASE
-
- - name: Create Release
- if: runner.os == 'Linux' # Create release only once
+ platform-name: ${{ matrix.platform.name }}
+ maven-username: ${{ secrets.MAVEN_USERNAME }}
+ maven-password: ${{ secrets.MAVEN_TOKEN }}
+ maven-gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
+ maven-gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
+
+ build-linux:
+ needs: prepare-release
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - name: linux_x86-64
+ runs-on: ubuntu-20.04
+ java: [17]
+ runs-on: ${{ matrix.platform.runs-on }}
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ fetch-tags: true
+
+ - name: Get tag from current branch
+ id: tag-selector
+ run: |
+ git fetch -a
+ tag=$(git describe --tags `git rev-list --tags --max-count=1`)
+ echo "tag=$tag" >> "$GITHUB_OUTPUT"
+ git checkout $tag
+
+ - name: Disk cleanup
+ run: |
+ set -x
+ df -h
+ #sudo du -h -d1 /usr/local
+ #sudo du -h -d1 /usr/local/share
+ #sudo du -h -d1 /usr/local/lib
+ #sudo du -h -d1 /usr/share
+ RMI=`docker images -q -a`
+ if [ -n "$RMI" ]; then
+ docker rmi $RMI
+ fi
+ # 4.6G
+ sudo rm -rf /usr/local/.ghcup
+ # 1.7G
+ sudo rm -rf /usr/share/swift
+ # 1.4G
+ sudo rm -rf /usr/share/dotnet
+ # 13G
+ sudo rm -rf /usr/local/lib/android
+ df -h
+
+ - name: Install required packages
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y pulseaudio libpulse-dev libasound2-dev libdbus-1-dev libudev-dev libv4l-dev libx11-dev binutils cmake git locales lsb-release ninja-build pkg-config python3 python3-setuptools rsync unzip wget xz-utils
+ # Required for testing
+ pulseaudio --start
+ #sudo apt-get install -y pipewire pipewire-pulse gstreamer1.0-pipewire libspa-0.2-bluetooth libspa-0.2-jack pipewire-audio-client-libraries
+ #systemctl --user daemon-reload
+ #systemctl --user --now enable pipewire{,-pulse}.{socket,service}
+
+ - name: Create Release # Create the release only once on Linux
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
- tag_name: ${{ github.ref }}
- release_name: Release ${{ github.ref }}
+ tag_name: ${{ steps.tag-selector.outputs.tag }}
+ release_name: Release ${{ steps.tag-selector.outputs.tag }}
draft: false
prerelease: false
- - name: Build
- run: mvn package -DskipTests -s .github/workflows/settings.xml
+ - id: maven-build
+ name: Maven build
+ uses: ./.github/actions/release
+ with:
+ java-version: ${{ matrix.java }}
+ platform-name: ${{ matrix.platform.name }}
+ maven-username: ${{ secrets.MAVEN_USERNAME }}
+ maven-password: ${{ secrets.MAVEN_TOKEN }}
+ maven-gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
+ maven-gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- - name: Test
- run: mvn -B jar:jar surefire:test
+ build-macos:
+ needs: prepare-release
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - name: macos_x86-64
+ runs-on: macos-13
+ - name: macos_arm64
+ runs-on: macos-14
+ java: [17]
+ runs-on: ${{ matrix.platform.runs-on }}
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ fetch-tags: true
- - name: Deploy
- env:
- GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
- NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
- run: mvn deploy -Prelease -DskipTests -s .github/workflows/settings.xml
+ - name: Get tag from current branch
+ id: tag-selector
+ run: |
+ git fetch -a
+ tag=$(git describe --tags `git rev-list --tags --max-count=1`)
+ echo "tag=$tag" >> "$GITHUB_OUTPUT"
+ git checkout $tag
+
+ - name: Install required packages
+ run: |
+ brew install ninja
+ # Required for macos-13
+ pip install setuptools
+ # Required for macos-14
+ brew install python-setuptools
+
+ - name: Select Xcode version
+ run: sudo xcode-select -s /Applications/Xcode_15.0.1.app/Contents/Developer
+
+ - id: maven-build
+ name: Maven build
+ uses: ./.github/actions/release
+ with:
+ java-version: ${{ matrix.java }}
+ platform-name: ${{ matrix.platform.name }}
+ maven-username: ${{ secrets.MAVEN_USERNAME }}
+ maven-password: ${{ secrets.MAVEN_TOKEN }}
+ maven-gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
+ maven-gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
diff --git a/.github/workflows/settings.xml b/.github/workflows/settings.xml
deleted file mode 100644
index 602739e2..00000000
--- a/.github/workflows/settings.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
- false
-
-
- build-properties
-
- true
-
-
- ${env.WEBRTC_CHECKOUT_FOLDER}
- ${env.WEBRTC_INSTALL_FOLDER}
-
-
-
-
\ No newline at end of file
diff --git a/webrtc-jni/src/main/cpp/dependencies/webrtc/CMakeLists.txt b/webrtc-jni/src/main/cpp/dependencies/webrtc/CMakeLists.txt
index c3f4c031..d6724d9d 100644
--- a/webrtc-jni/src/main/cpp/dependencies/webrtc/CMakeLists.txt
+++ b/webrtc-jni/src/main/cpp/dependencies/webrtc/CMakeLists.txt
@@ -1,8 +1,10 @@
cmake_minimum_required(VERSION 3.13)
project(webrtc)
-# Used for Linux sysroot installation
-find_package(Python3 REQUIRED COMPONENTS Interpreter)
+if(LINUX)
+ # Used for Linux sysroot installation
+ find_package(Python3 REQUIRED COMPONENTS Interpreter)
+endif()
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pseudo.hxx
"template class pseudo{}\n")