Skip to content

Commit

Permalink
feat: build and preview workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
abdallahmehiz committed Jun 6, 2024
1 parent ea34ad7 commit 8433c76
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
cache: 'gradle'

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew assembleDebug
31 changes: 31 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Preview

on: [workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
cache: 'gradle'

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew assemblePreview

- name: Upload the APK artifact
uses: actions/upload-artifact@v4
with:
path: ./app/build/outputs/apk/preview/*.apk
name: packages
retention-days: 14
15 changes: 13 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,23 @@ android {
}

buildTypes {
release {
isMinifyEnabled = false
named("release") {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
create("preview") {
initWith(getByName("release"))

signingConfig = signingConfigs["debug"]
applicationIdSuffix = ".preview"
}
named("debug") {
applicationIdSuffix = ".debug"
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -84,6 +94,7 @@ dependencies {

implementation(libs.aniyomi.mpv.lib)
implementation(libs.aniyomi.ffmpeg.kit)
implementation(libs.arthentica.smartexceptions)

implementation(libs.seeker)
implementation(libs.bundles.koin)
Expand Down
4 changes: 3 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
-keep,allowoptimization class is.xyz.mpv.** { public protected *; }
-keep,allowoptimization class com.arthenica.** { public protected *; }
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.os.Bundle
import android.os.ParcelFileDescriptor
import android.util.Log
import android.view.WindowManager
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.WindowCompat
import `is`.xyz.mpv.MPVLib
Expand Down Expand Up @@ -36,6 +37,7 @@ class PlayerActivity : AppCompatActivity() {
private val subtitlesPreferences by inject<SubtitlesPreferences>()

override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ androidx-compose-constraintlayout = { group = "androidx.constraintlayout", name

aniyomi-mpv-lib = { module = "com.github.aniyomiorg:aniyomi-mpv-lib", version = "1.15.n" }
aniyomi-ffmpeg-kit = { module = "com.github.jmir1:ffmpeg-kit", version = "1.15" }
arthentica-smartexceptions = { module = "com.arthenica:smart-exception-java", version = "0.2.1" }

seeker = { module = "io.github.2307vivek:seeker", version = "1.2.2" }

Expand Down

0 comments on commit 8433c76

Please sign in to comment.