Repository navigation
ci: harden the release workflow and keep native caches warm #371
Workflow file for this run
This file contains hidden or 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: Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # Everything that can change a build runs here: poms, CMake files, the FFmpeg | |
| # submodule and this directory too, not only sources. A PR cannot read the | |
| # caches of another PR, only those of main, so a build change that main does | |
| # not rebuild leaves every following PR to build WebRTC from scratch. | |
| paths-ignore: | |
| - "docs/**" | |
| - "**.md" | |
| - ".github/ISSUE_TEMPLATE/**" | |
| - ".github/workflows/pages.yml" | |
| # A change that only touches docs cannot affect the native build. The docs | |
| # site has its own check in pages.yml. | |
| pull_request: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - "docs/**" | |
| - "**.md" | |
| - ".github/ISSUE_TEMPLATE/**" | |
| - ".github/workflows/pages.yml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| # A new push to a PR supersedes its running build. On main every run is kept, | |
| # since each one deploys a snapshot and refreshes the caches. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| env: | |
| WEBRTC_CHECKOUT_FOLDER: webrtc | |
| WEBRTC_INSTALL_FOLDER: webrtc/build | |
| jobs: | |
| build-windows: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - name: windows_x86_64 | |
| runs-on: windows-2022 | |
| - name: windows_arm64 | |
| runs-on: windows-2022 | |
| java: [17] | |
| runs-on: ${{ matrix.platform.runs-on }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| # The media module builds FFmpeg from its third-party submodule. | |
| submodules: true | |
| - id: prepare | |
| name: Prepare build | |
| uses: ./.github/actions/prepare-windows | |
| - id: maven-build | |
| name: Maven build | |
| uses: ./.github/actions/build | |
| with: | |
| java-version: ${{ matrix.java }} | |
| platform-name: ${{ matrix.platform.name }} | |
| maven-username: ${{ secrets.MAVEN_USERNAME }} | |
| maven-password: ${{ secrets.MAVEN_TOKEN }} | |
| - name: Upload natives for native testing | |
| if: matrix.platform.name == 'windows_arm64' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: natives-${{ matrix.platform.name }} | |
| path: | | |
| webrtc-jni/target/webrtc-java-*.jar | |
| webrtc-java-media/target/webrtc-java-media-*.jar | |
| if-no-files-found: error | |
| build-linux: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - name: linux_arm | |
| runs-on: ubuntu-22.04 | |
| - name: linux_arm64 | |
| runs-on: ubuntu-22.04 | |
| - name: linux_x86-64 | |
| runs-on: ubuntu-22.04 | |
| java: [17] | |
| runs-on: ${{ matrix.platform.runs-on }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| # The media module builds FFmpeg from its third-party submodule. | |
| submodules: true | |
| - id: prepare | |
| name: Prepare build | |
| uses: ./.github/actions/prepare-linux | |
| - id: maven-build | |
| name: Maven build | |
| uses: ./.github/actions/build | |
| with: | |
| java-version: ${{ matrix.java }} | |
| platform-name: ${{ matrix.platform.name }} | |
| maven-username: ${{ secrets.MAVEN_USERNAME }} | |
| maven-password: ${{ secrets.MAVEN_TOKEN }} | |
| - name: Upload natives for native testing | |
| if: matrix.platform.name == 'linux_arm' || matrix.platform.name == 'linux_arm64' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: natives-${{ matrix.platform.name }} | |
| path: | | |
| webrtc-jni/target/webrtc-java-*.jar | |
| webrtc-java-media/target/webrtc-java-media-*.jar | |
| if-no-files-found: error | |
| build-macos: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - name: macos_x86-64 | |
| runs-on: macos-14 | |
| - name: macos_arm64 | |
| runs-on: macos-14 | |
| java: [17] | |
| runs-on: ${{ matrix.platform.runs-on }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| # The media module builds FFmpeg from its third-party submodule. | |
| submodules: true | |
| - id: prepare-build | |
| name: Prepare build | |
| uses: ./.github/actions/prepare-macos | |
| - id: maven-build-arm64 | |
| name: Maven build - Apple Silicon | |
| if: matrix.platform.name == 'macos_arm64' | |
| uses: ./.github/actions/build | |
| with: | |
| java-version: ${{ matrix.java }} | |
| platform-name: ${{ matrix.platform.name }} | |
| maven-username: ${{ secrets.MAVEN_USERNAME }} | |
| maven-password: ${{ secrets.MAVEN_TOKEN }} | |
| - id: maven-build-x86_64 | |
| name: Maven build - Intel | |
| if: matrix.platform.name == 'macos_x86-64' | |
| uses: ./.github/actions/build-macos-x86_64 | |
| with: | |
| java-version: ${{ matrix.java }} | |
| platform-name: ${{ matrix.platform.name }} | |
| maven-username: ${{ secrets.MAVEN_USERNAME }} | |
| maven-password: ${{ secrets.MAVEN_TOKEN }} | |
| test-natives: | |
| needs: [build-windows, build-linux] | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - name: windows_arm64 | |
| runs-on: windows-11-arm | |
| classifier: windows-aarch64 | |
| profile: windows-aarch64 | |
| java-distribution: microsoft | |
| java-architecture: aarch64 | |
| - name: linux_arm64 | |
| runs-on: ubuntu-22.04-arm | |
| classifier: linux-aarch64 | |
| profile: linux-aarch64 | |
| java-distribution: temurin | |
| java-architecture: '' | |
| - name: linux_arm | |
| runs-on: ubuntu-22.04-arm | |
| classifier: linux-aarch32 | |
| profile: linux-aarch32 | |
| java-distribution: liberica | |
| java-architecture: armv7 | |
| runs-on: ${{ matrix.platform.runs-on }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Test natives | |
| uses: ./.github/actions/test-natives | |
| with: | |
| platform-name: ${{ matrix.platform.name }} | |
| classifier: ${{ matrix.platform.classifier }} | |
| profile: ${{ matrix.platform.profile }} | |
| java-distribution: ${{ matrix.platform.java-distribution }} | |
| java-architecture: ${{ matrix.platform.java-architecture }} |