Skip to content

Commit

Permalink
Add build workflow and rework publish workflow
Browse files Browse the repository at this point in the history
Switch to latest runner, use gradle-setup-action, tweak naming
  • Loading branch information
Maxr1998 authored and nielsvanvelzen committed Oct 5, 2022
1 parent 3c40c29 commit a1a6c19
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/extension-build.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 7 additions & 5 deletions .github/workflows/extension-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ExoPlayer FFmpeg Extension Publish
name: ExoPlayer FFmpeg Extension / Publish

on:
push:
Expand All @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit a1a6c19

Please sign in to comment.