diff --git a/.github/workflows/extension-build.yaml b/.github/workflows/extension-build.yaml new file mode 100644 index 0000000..c7973f1 --- /dev/null +++ b/.github/workflows/extension-build.yaml @@ -0,0 +1,38 @@ +name: ExoPlayer FFmpeg Extension / Build + +on: + push: + branches: + - master + pull_request: + +env: + NDK_VER: 21.4.7075529 + +jobs: + build: + name: Build + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3 + with: + submodules: recursive + - name: Setup Java + uses: actions/setup-java@a18c333f3f14249953dab3e186e5e21bf3390f1d # tag=v3 + with: + distribution: temurin + java-version: 11 + - name: Setup Gradle + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 + - name: Cache NDK + uses: actions/cache@v3 + with: + path: /usr/local/lib/android/sdk/ndk/${{ env.NDK_VER }} + key: ${{ runner.os }}-${{ env.NDK_VER }} + - name: Install correct NDK + run: sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;${NDK_VER}" + - name: Build ffmpeg + run: ./build.sh + - name: Build extension and publish library locally + run: ./gradlew :exoplayer-ffmpeg-extension:publishToMavenLocal diff --git a/.github/workflows/extension-publish.yaml b/.github/workflows/extension-publish.yaml index 03777c1..8dd449b 100644 --- a/.github/workflows/extension-publish.yaml +++ b/.github/workflows/extension-publish.yaml @@ -1,4 +1,4 @@ -name: ExoPlayer FFmpeg Extension Publish +name: ExoPlayer FFmpeg Extension / Publish on: push: @@ -11,10 +11,11 @@ env: NDK_VER: 21.4.7075529 jobs: - build: - runs-on: ubuntu-20.04 + publish: + name: Publish + runs-on: ubuntu-22.04 environment: release - if: ${{ startsWith(github.ref, 'refs/tags/v') || github.repository == 'jellyfin/jellyfin-exoplayer-ffmpeg-extension' }} + if: ${{ contains(github.repository_owner, 'jellyfin') || startsWith(github.ref, 'refs/tags/v') }} steps: - name: Checkout repository uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3 @@ -25,7 +26,8 @@ jobs: with: distribution: temurin java-version: 11 - cache: gradle + - name: Setup Gradle + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 - name: Cache NDK uses: actions/cache@v3 with: