Optimize imports, try to add GitHub release support
This is not a code change release, so you can continue to use the previous version.
This commit is contained in:
parent
152c7b8bb9
commit
17bec86f4c
4 changed files with 21 additions and 14 deletions
27
.github/workflows/main.yml
vendored
27
.github/workflows/main.yml
vendored
|
|
@ -16,6 +16,8 @@ jobs:
|
|||
build:
|
||||
name: Build on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
|
@ -66,8 +68,11 @@ jobs:
|
|||
id: buildAll
|
||||
run: |
|
||||
./gradlew assemble
|
||||
echo "releaseName=$(ls app/build/outputs/apk/release/*.apk | awk -F '(/|.apk)' '{print $5}')" >> $GITHUB_OUTPUT
|
||||
echo "debugName=$(ls app/build/outputs/apk/debug/*.apk | awk -F '(/|.apk)' '{print $5}')" >> $GITHUB_OUTPUT
|
||||
echo "releaseName=$(ls app/build/outputs/apk/release/*.apk | awk -F '(/|.apk)' '{print $6}')" >> $GITHUB_OUTPUT
|
||||
echo "debugName=$(ls app/build/outputs/apk/debug/*.apk | awk -F '(/|.apk)' '{print $6}')" >> $GITHUB_OUTPUT
|
||||
echo "releaseFile=$(ls app/build/outputs/apk/release/*.apk)" >> $GITHUB_OUTPUT
|
||||
echo "debugFile=$(ls app/build/outputs/apk/debug/*.apk)" >> $GITHUB_OUTPUT
|
||||
echo "ossNum=$(ls app/build/outputs/apk/debug/*.apk | awk -F '(/|.apk)' '{print $6}' | cut -f4 -d'-')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Upload release
|
||||
if: success()
|
||||
|
|
@ -89,6 +94,17 @@ jobs:
|
|||
name: mappings
|
||||
path: "app/build/outputs/mapping/release"
|
||||
|
||||
- name: Upload to GitHub release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
name: oss-${{ steps.buildAll.outputs.ossNum }}
|
||||
body: ${{ github.event.head_commit.message }}
|
||||
files: |
|
||||
${{ steps.buildAll.outputs.releaseFile }}
|
||||
${{ steps.buildAll.outputs.debugFile }}
|
||||
tag_name: oss-${{ steps.buildAll.outputs.ossNum }}
|
||||
|
||||
- name: Post to channel
|
||||
if: ${{ github.event_name != 'pull_request' && success() && github.ref == 'refs/heads/master' }}
|
||||
env:
|
||||
|
|
@ -97,8 +113,7 @@ jobs:
|
|||
COMMIT_URL: ${{ github.event.head_commit.url }}
|
||||
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
run: |
|
||||
OUTPUT="app/build/outputs/apk/"
|
||||
export release=$(find $OUTPUT -name "*-release.apk")
|
||||
export debug=$(find $OUTPUT -name "*-debug.apk")
|
||||
export release=${{ steps.buildAll.outputs.releaseFile }}
|
||||
export debug=${{ steps.buildAll.outputs.debugFile }}
|
||||
ESCAPED=`python3 -c 'import json,os,urllib.parse; msg = json.dumps(os.environ["COMMIT_MESSAGE"]); print(urllib.parse.quote(msg if len(msg) <= 1024 else json.dumps(os.environ["COMMIT_URL"])))'`
|
||||
curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${CHANNEL_ID}&media=%5B%7B%22type%22:%22document%22,%20%22media%22:%22attach://release%22%7D,%7B%22type%22:%22document%22,%20%22media%22:%22attach://debug%22,%22caption%22:${ESCAPED}%7D%5D" -F release="@$release" -F debug="@$debug"
|
||||
curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${CHANNEL_ID}&media=%5B%7B%22type%22:%22document%22,%20%22media%22:%22attach://release%22%7D,%7B%22type%22:%22document%22,%20%22media%22:%22attach://debug%22,%22caption%22:${ESCAPED}%7D%5D" -F release="@$release" -F debug="@$debug"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import icu.nullptr.hidemyapplist.ui.adapter.AppSelectAdapter
|
|||
import icu.nullptr.hidemyapplist.ui.view.AppItemView
|
||||
import icu.nullptr.hidemyapplist.util.PackageHelper
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlin.lazy
|
||||
|
||||
class AppPresetAdapter(
|
||||
private val presetName: String
|
||||
|
|
|
|||
|
|
@ -9,13 +9,8 @@ import icu.nullptr.hidemyapplist.service.PrefManager
|
|||
import icu.nullptr.hidemyapplist.ui.fragment.AppSelectFragment
|
||||
import icu.nullptr.hidemyapplist.util.PackageHelper
|
||||
import icu.nullptr.hidemyapplist.util.PackageHelper.Comparators
|
||||
import kotlinx.coroutines.CoroutineStart
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.coroutineScope
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import org.frknkrc44.hma_oss.ui.adapter.AppPresetAdapter
|
||||
import kotlin.coroutines.suspendCoroutine
|
||||
|
||||
class AppPresetFragment() : AppSelectFragment() {
|
||||
|
||||
|
|
|
|||
|
|
@ -6,13 +6,11 @@ import android.view.View
|
|||
import android.view.WindowInsets
|
||||
import androidx.core.view.doOnPreDraw
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import by.kirich1409.viewbindingdelegate.viewBinding
|
||||
import icu.nullptr.hidemyapplist.service.ConfigManager
|
||||
import icu.nullptr.hidemyapplist.ui.util.navController
|
||||
import icu.nullptr.hidemyapplist.ui.util.setupToolbar
|
||||
import kotlinx.coroutines.launch
|
||||
import org.frknkrc44.hma_oss.R
|
||||
import org.frknkrc44.hma_oss.databinding.FragmentPresetManageBinding
|
||||
import org.frknkrc44.hma_oss.ui.adapter.AppPresetListAdapter
|
||||
|
|
|
|||
Loading…
Reference in a new issue