Skip to content

fix: harden JNI error handling #575

fix: harden JNI error handling

fix: harden JNI error handling #575

Workflow file for this run

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' }}
jobs:
platforms:
uses: ./.github/workflows/platforms.yml
with:
# Only the deploy-snapshot job of this same run reads them.
retention-days: 1
# One deployment with the natives of every platform attached, the way
# release.yml publishes a release, instead of seven jobs each deploying the
# whole reactor and racing on the snapshot metadata. It runs only once every
# platform has been built and tested.
deploy-snapshot:
name: Deploy snapshot
needs: platforms
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && github.repository == 'devopvoid/webrtc-java'
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Maven cache
uses: actions/cache@v6
with:
path: |
~/.m2/repository
!~/.m2/repository/dev/onvoid/webrtc
key: maven-publish-${{ hashFiles('**/pom.xml') }}
restore-keys: maven-publish-
- name: Set up JDK 17
uses: actions/setup-java@v6
with:
java-version: '17'
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_TOKEN
- name: Determine the version to deploy
id: version
run: |
version=$(mvn -B -q -N help:evaluate -Dexpression=project.version -DforceStdout)
echo "Version to deploy: $version"
if [[ "$version" != *-SNAPSHOT ]]; then
echo "::error::main is at $version, which is not a snapshot; releases are published by release.yml"
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Deploy
uses: ./.github/actions/publish
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
with:
version: ${{ steps.version.outputs.version }}