add separate upload in github action
This commit is contained in:
parent
66bf4b5ae7
commit
83e3ae09f2
5 changed files with 122 additions and 24 deletions
97
.github/workflows/android.yml
vendored
97
.github/workflows/android.yml
vendored
|
|
@ -4,6 +4,9 @@ env:
|
||||||
# The name of the main module repository
|
# The name of the main module repository
|
||||||
main_project_module: app
|
main_project_module: app
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write # for deleting/creating a pre-release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
|
|
@ -13,10 +16,9 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
contents: write # for deleting/creating a pre-release
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: set up JDK 17
|
- name: set up JDK 17
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -47,20 +49,99 @@ jobs:
|
||||||
# Create APK Release
|
# Create APK Release
|
||||||
- name: Build apk release project (APK)
|
- name: Build apk release project (APK)
|
||||||
run: ./gradlew assemble
|
run: ./gradlew assemble
|
||||||
|
|
||||||
# Upload Artifact Build
|
# Upload Artifact Build
|
||||||
# Noted For Output [main_project_module]/build/outputs/apk/debug/
|
# Noted For Output [main_project_module]/build/outputs/apk/debug/
|
||||||
- name: Upload APK Debug
|
- name: Find Debug arm64
|
||||||
|
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/debug/ -type f -name '*arm64*.apk')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Upload APK Debug arm64
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: YTDLnis APK debug generated
|
name: ytdlnis-autogenerated-arm64-v8a-debug
|
||||||
path: ${{ env.main_project_module }}/build/outputs/apk/debug/
|
path: ${{ env.APK_PATH }}
|
||||||
|
|
||||||
|
- name: Find Debug armeabiv7
|
||||||
|
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/debug/ -type f -name '*armeabi*.apk')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Upload APK Debug armeabiv7
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ytdlnis-autogenerated-armeabi-v7a-debug
|
||||||
|
path: ${{ env.APK_PATH }}
|
||||||
|
|
||||||
|
- name: Find Debug universal
|
||||||
|
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/debug/ -type f -name '*universal*.apk')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Upload APK Debug universal
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ytdlnis-autogenerated-universal-debug
|
||||||
|
path: ${{ env.APK_PATH }}
|
||||||
|
|
||||||
|
- name: Find Debug x86
|
||||||
|
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/debug/ -type f -name '*x86*.apk')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Upload APK Debug x86
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ytdlnis-autogenerated-x86-debug
|
||||||
|
path: ${{ env.APK_PATH }}
|
||||||
|
|
||||||
|
- name: Find Debug x86_64
|
||||||
|
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/debug/ -type f -name '*x86_64*.apk')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Upload APK Debug x86_64
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ytdlnis-autogenerated-x86_64-debug
|
||||||
|
path: ${{ env.APK_PATH }}
|
||||||
|
|
||||||
# Noted For Output [main_project_module]/build/outputs/apk/release/
|
# Noted For Output [main_project_module]/build/outputs/apk/release/
|
||||||
- name: Upload APK Release
|
- name: Find Release arm64
|
||||||
|
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/release/ -type f -name '*arm64*.apk')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Upload APK Release arm64
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: YTDLnis APK release generated
|
name: ytdlnis-autogenerated-arm64-v8a-release
|
||||||
path: ${{ env.main_project_module }}/build/outputs/apk/release/
|
path: ${{ env.APK_PATH }}
|
||||||
|
|
||||||
|
- name: Find Release armeabiv7
|
||||||
|
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/release/ -type f -name '*armeabi*.apk')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Upload APK Release armeabiv7
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ytdlnis-autogenerated-armeabi-v7a-release
|
||||||
|
path: ${{ env.APK_PATH }}
|
||||||
|
|
||||||
|
- name: Find Release universal
|
||||||
|
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/release/ -type f -name '*universal*.apk')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Upload APK Release universal
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ytdlnis-autogenerated-universal-release
|
||||||
|
path: ${{ env.APK_PATH }}
|
||||||
|
|
||||||
|
- name: Find Release x86
|
||||||
|
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/release/ -type f -name '*x86*.apk')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Upload APK Release x86
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ytdlnis-autogenerated-x86-release
|
||||||
|
path: ${{ env.APK_PATH }}
|
||||||
|
|
||||||
|
- name: Find Release x86_64
|
||||||
|
run: echo "APK_PATH=$(find ${{ env.main_project_module }}/build/outputs/apk/release/ -type f -name '*x86_64*.apk')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Upload APK Release x86_64
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ytdlnis-autogenerated-x86_64-release
|
||||||
|
path: ${{ env.APK_PATH }}
|
||||||
|
|
||||||
# Send Message To Telegram
|
# Send Message To Telegram
|
||||||
- name: send telegram message on push or pull
|
- name: send telegram message on push or pull
|
||||||
|
|
|
||||||
|
|
@ -169,21 +169,31 @@ class GeneralSettingsFragment : BaseSettingsFragment() {
|
||||||
findPreference<ListPreference>("ytdlnis_theme")?.apply {
|
findPreference<ListPreference>("ytdlnis_theme")?.apply {
|
||||||
summary = entry
|
summary = entry
|
||||||
setOnPreferenceChangeListener { _, newValue ->
|
setOnPreferenceChangeListener { _, newValue ->
|
||||||
summary = when(newValue){
|
val dialog = MaterialAlertDialogBuilder(context)
|
||||||
"System" -> {
|
dialog.setTitle(context.getString(R.string.app_icon_change))
|
||||||
getString(R.string.system)
|
dialog.setNegativeButton(context.getString(R.string.cancel)) { dialogInterface: DialogInterface, _: Int -> dialogInterface.cancel() }
|
||||||
}
|
dialog.setPositiveButton(context.getString(R.string.ok)) { _: DialogInterface?, _: Int ->
|
||||||
|
summary = when(newValue){
|
||||||
|
"System" -> {
|
||||||
|
getString(R.string.system)
|
||||||
|
}
|
||||||
|
|
||||||
"Dark" -> {
|
"Dark" -> {
|
||||||
getString(R.string.dark)
|
getString(R.string.dark)
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
getString(R.string.light)
|
getString(R.string.light)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
editor.putString("ytdlnis_theme", newValue.toString()).apply()
|
||||||
|
ThemeUtil.updateThemes()
|
||||||
}
|
}
|
||||||
ThemeUtil.updateThemes()
|
dialog.show()
|
||||||
true
|
|
||||||
|
|
||||||
|
|
||||||
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -598,7 +598,6 @@ class YTDLPUtil(private val context: Context, private val commandTemplateDao: Co
|
||||||
}else{
|
}else{
|
||||||
request.addOption("-I", "${downloadItem.playlistIndex!!}:${downloadItem.playlistIndex}")
|
request.addOption("-I", "${downloadItem.playlistIndex!!}:${downloadItem.playlistIndex}")
|
||||||
}
|
}
|
||||||
request.addOption("-i")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -861,7 +860,7 @@ class YTDLPUtil(private val context: Context, private val commandTemplateDao: Co
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abrSort.isNotBlank()){
|
if (abrSort.isNotBlank()){
|
||||||
formatSorting.add(0, "abr:${abrSort}")
|
formatSorting.add(0, "abr~${abrSort}")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(formatSorting.isNotEmpty()) {
|
if(formatSorting.isNotEmpty()) {
|
||||||
|
|
@ -902,6 +901,10 @@ class YTDLPUtil(private val context: Context, private val commandTemplateDao: Co
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (usePlaylistMetadata) {
|
||||||
|
metadataCommands.addOption("--parse-metadata", "%(album,playlist_title,playlist|)s:%(album)s")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
metadataCommands.addOption("--parse-metadata", "%(album_artist,first_artist|)s:%(album_artist)s")
|
metadataCommands.addOption("--parse-metadata", "%(album_artist,first_artist|)s:%(album_artist)s")
|
||||||
metadataCommands.addOption("--parse-metadata", "description:(?:.+?Released\\ on\\s*:\\s*(?P<dscrptn_year>\\d{4}))?")
|
metadataCommands.addOption("--parse-metadata", "description:(?:.+?Released\\ on\\s*:\\s*(?P<dscrptn_year>\\d{4}))?")
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ import androidx.work.OneTimeWorkRequestBuilder
|
||||||
import androidx.work.WorkManager
|
import androidx.work.WorkManager
|
||||||
import androidx.work.WorkerParameters
|
import androidx.work.WorkerParameters
|
||||||
import com.deniscerri.ytdl.App
|
import com.deniscerri.ytdl.App
|
||||||
import com.deniscerri.ytdl.R
|
|
||||||
import com.deniscerri.ytdl.database.DBManager
|
import com.deniscerri.ytdl.database.DBManager
|
||||||
import com.deniscerri.ytdl.database.models.DownloadItem
|
import com.deniscerri.ytdl.database.models.DownloadItem
|
||||||
import com.deniscerri.ytdl.database.repository.DownloadRepository
|
import com.deniscerri.ytdl.database.repository.DownloadRepository
|
||||||
|
|
@ -23,7 +22,6 @@ import com.deniscerri.ytdl.database.repository.HistoryRepository
|
||||||
import com.deniscerri.ytdl.database.repository.ObserveSourcesRepository
|
import com.deniscerri.ytdl.database.repository.ObserveSourcesRepository
|
||||||
import com.deniscerri.ytdl.database.repository.ResultRepository
|
import com.deniscerri.ytdl.database.repository.ResultRepository
|
||||||
import com.deniscerri.ytdl.util.Extensions.calculateNextTimeForObserving
|
import com.deniscerri.ytdl.util.Extensions.calculateNextTimeForObserving
|
||||||
import com.deniscerri.ytdl.util.Extensions.needsDataUpdating
|
|
||||||
import com.deniscerri.ytdl.util.FileUtil
|
import com.deniscerri.ytdl.util.FileUtil
|
||||||
import com.deniscerri.ytdl.util.NotificationUtil
|
import com.deniscerri.ytdl.util.NotificationUtil
|
||||||
import com.deniscerri.ytdl.util.extractors.YTDLPUtil
|
import com.deniscerri.ytdl.util.extractors.YTDLPUtil
|
||||||
|
|
@ -47,6 +45,7 @@ class ObserveSourceWorker(
|
||||||
val downloadRepo = DownloadRepository(dbManager.downloadDao)
|
val downloadRepo = DownloadRepository(dbManager.downloadDao)
|
||||||
val commandTemplateDao = dbManager.commandTemplateDao
|
val commandTemplateDao = dbManager.commandTemplateDao
|
||||||
val ytdlpUtil = YTDLPUtil(context, commandTemplateDao)
|
val ytdlpUtil = YTDLPUtil(context, commandTemplateDao)
|
||||||
|
val resultRepository = ResultRepository(dbManager.resultDao, commandTemplateDao, context)
|
||||||
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
|
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
|
||||||
val item = repo.getByID(sourceID)
|
val item = repo.getByID(sourceID)
|
||||||
|
|
@ -63,7 +62,7 @@ class ObserveSourceWorker(
|
||||||
}
|
}
|
||||||
|
|
||||||
val list = kotlin.runCatching {
|
val list = kotlin.runCatching {
|
||||||
ytdlpUtil.getFromYTDL(item.url)
|
resultRepository.getResultsFromSource(item.url, resetResults = false, addToResults = false, singleItem = false)
|
||||||
}.onFailure {
|
}.onFailure {
|
||||||
Log.e("observe", it.toString())
|
Log.e("observe", it.toString())
|
||||||
}.getOrElse { listOf() }
|
}.getOrElse { listOf() }
|
||||||
|
|
@ -114,6 +113,10 @@ class ObserveSourceWorker(
|
||||||
res.forEach {
|
res.forEach {
|
||||||
val string = Gson().toJson(item.downloadItemTemplate, DownloadItem::class.java)
|
val string = Gson().toJson(item.downloadItemTemplate, DownloadItem::class.java)
|
||||||
val downloadItem = Gson().fromJson(string, DownloadItem::class.java)
|
val downloadItem = Gson().fromJson(string, DownloadItem::class.java)
|
||||||
|
downloadItem.title = it.title
|
||||||
|
downloadItem.author = it.author
|
||||||
|
downloadItem.duration = it.duration
|
||||||
|
downloadItem.website = it.website
|
||||||
downloadItem.url = it.url
|
downloadItem.url = it.url
|
||||||
downloadItem.thumb = it.thumb
|
downloadItem.thumb = it.thumb
|
||||||
downloadItem.status = DownloadRepository.Status.Queued.toString()
|
downloadItem.status = DownloadRepository.Status.Queued.toString()
|
||||||
|
|
|
||||||
|
|
@ -463,4 +463,5 @@
|
||||||
<string name="use_only_po_token">Use only PO Token (Ignore Player Client)</string>
|
<string name="use_only_po_token">Use only PO Token (Ignore Player Client)</string>
|
||||||
<string name="cache_directory">Cache Folder</string>
|
<string name="cache_directory">Cache Folder</string>
|
||||||
<string name="cache_directory_warning">Changing the Cache Folder might cause unexpected issues. If the app cannot write to the configured path, it will resort to the default internal cache directory</string>
|
<string name="cache_directory_warning">Changing the Cache Folder might cause unexpected issues. If the app cannot write to the configured path, it will resort to the default internal cache directory</string>
|
||||||
|
<string name="app_icon_change">Icon could change and Application will close</string>
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Reference in a new issue