fix: tasker launch of shortcuts (#290)
This commit is contained in:
parent
a5e9aa83b8
commit
594834a908
|
@ -86,9 +86,12 @@ jobs:
|
|||
# Build and sign APK ("-x test" argument is used to skip tests)
|
||||
# add fdroid flavor for apk upload
|
||||
- name: Build Fdroid Release APK
|
||||
if: ${{ inputs.release_type != '' && inputs.release_type != 'nightly' }}
|
||||
if: ${{ inputs.release_type != '' && inputs.release_type == 'release' }}
|
||||
run: ./gradlew :app:assembleFdroidRelease -x test
|
||||
|
||||
- name: Build Fdroid Prerelease APK
|
||||
if: ${{ inputs.release_type != '' && inputs.release_type == 'prerelease' }}
|
||||
run: ./gradlew :app:assembleFdroidPrerelease -x test
|
||||
|
||||
- name: Build Fdroid Nightly APK
|
||||
if: ${{ inputs.release_type == '' || inputs.release_type == 'nightly' }}
|
||||
|
@ -96,11 +99,13 @@ jobs:
|
|||
|
||||
- if: ${{ inputs.release_type == '' || inputs.release_type == 'nightly' }}
|
||||
run: echo "APK_PATH=$(find . -regex '^.*/build/outputs/apk/fdroid/nightly/.*\.apk$' -type f | head -1)" >> $GITHUB_ENV
|
||||
- if: ${{ inputs.release_type != '' && inputs.release_type != 'nightly' }}
|
||||
- if: ${{ inputs.release_type != '' && inputs.release_type == 'release' }}
|
||||
run: echo "APK_PATH=$(find . -regex '^.*/build/outputs/apk/fdroid/release/.*\.apk$' -type f | head -1)" >> $GITHUB_ENV
|
||||
- if: ${{ inputs.release_type != '' && inputs.release_type == 'prerelease' }}
|
||||
run: echo "APK_PATH=$(find . -regex '^.*/build/outputs/apk/fdroid/prerelease/.*\.apk$' -type f | head -1)" >> $GITHUB_ENV
|
||||
|
||||
- name: Get version code
|
||||
if: ${{ inputs.release_type == 'release' || inputs.release_type == 'prerelease' }}
|
||||
if: ${{ inputs.release_type == 'release' }}
|
||||
run: |
|
||||
version_code=$(grep "VERSION_CODE" buildSrc/src/main/kotlin/Constants.kt | awk '{print $5}' | tr -d '\n')
|
||||
echo "VERSION_CODE=$version_code" >> $GITHUB_ENV
|
||||
|
@ -126,31 +131,31 @@ jobs:
|
|||
event-type: fdroid-update
|
||||
|
||||
- name: Set version release notes
|
||||
if: ${{ inputs.release_type == 'release' || inputs.release_type == 'prerelease' }}
|
||||
if: ${{ inputs.release_type == 'release' }}
|
||||
run: |
|
||||
RELEASE_NOTES="$(cat ${{ github.workspace }}/fastlane/metadata/android/en-US/changelogs/${{ env.VERSION_CODE }}.txt)"
|
||||
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
|
||||
echo "$RELEASE_NOTES" >> $GITHUB_ENV
|
||||
echo "EOF" >> $GITHUB_ENV
|
||||
|
||||
- name: On nightly release
|
||||
- name: On nightly release notes
|
||||
if: ${{ contains(env.TAG_NAME, 'nightly') }}
|
||||
run: |
|
||||
echo "RELEASE_NOTES=Nightly build for the latest development version of the app." >> $GITHUB_ENV
|
||||
gh release delete nightly --yes || true
|
||||
|
||||
- name: On prerelease release notes
|
||||
if: ${{ inputs.release_type == 'prerelease' }}
|
||||
run: |
|
||||
echo "RELEASE_NOTES=Testing version of app for specific feature." >> $GITHUB_ENV
|
||||
gh release delete ${{ github.event.inputs.tag_name }} --yes || true
|
||||
|
||||
# Setup TAG_NAME, which is used as a general "name"
|
||||
- if: github.event_name == 'workflow_dispatch'
|
||||
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
|
||||
- if: github.event_name == 'schedule'
|
||||
run: echo "TAG_NAME=nightly" >> $GITHUB_ENV
|
||||
|
||||
- name: On nightly release
|
||||
if: ${{ contains(env.TAG_NAME, 'nightly') }}
|
||||
run: |
|
||||
echo "RELEASE_NOTES=Nightly build of the latest development version of the android client." >> $GITHUB_ENV
|
||||
gh release delete nightly --yes || true
|
||||
|
||||
- name: Get checksum
|
||||
id: checksum
|
||||
run: echo "checksum=$(apksigner verify -print-certs ${{ env.APK_PATH }} | grep -Po "(?<=SHA-256 digest:) .*" | tr -d "[:blank:]")" >> $GITHUB_OUTPUT
|
||||
|
@ -164,7 +169,7 @@ jobs:
|
|||
with:
|
||||
body: |
|
||||
${{ env.RELEASE_NOTES }}
|
||||
|
||||
|
||||
SHA256 fingerprint:
|
||||
```${{ steps.checksum.outputs.checksum }}```
|
||||
tag_name: ${{ env.TAG_NAME }}
|
||||
|
|
|
@ -60,6 +60,10 @@ android {
|
|||
}
|
||||
debug { isDebuggable = true }
|
||||
|
||||
create(Constants.PRERELEASE) {
|
||||
initWith(buildTypes.getByName(Constants.RELEASE))
|
||||
}
|
||||
|
||||
create(Constants.NIGHTLY) {
|
||||
initWith(buildTypes.getByName(Constants.RELEASE))
|
||||
}
|
||||
|
@ -184,19 +188,22 @@ dependencies {
|
|||
}
|
||||
|
||||
fun determineVersionCode(): Int {
|
||||
return if (isNightlyBuild()) {
|
||||
Constants.VERSION_CODE +
|
||||
Constants.NIGHTLY_CODE
|
||||
} else {
|
||||
Constants.VERSION_CODE
|
||||
return with(getBuildTaskName().lowercase()) {
|
||||
when {
|
||||
contains(Constants.NIGHTLY) -> Constants.VERSION_CODE + Constants.NIGHTLY_CODE
|
||||
contains(Constants.PRERELEASE) -> Constants.VERSION_CODE + Constants.PRERELEASE_CODE
|
||||
else -> Constants.VERSION_CODE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun determineVersionName(): String {
|
||||
return if (isNightlyBuild()) {
|
||||
Constants.VERSION_NAME +
|
||||
"-${grgitService.service.get().grgit.head().abbreviatedId}"
|
||||
} else {
|
||||
Constants.VERSION_NAME
|
||||
return with(getBuildTaskName().lowercase()) {
|
||||
when {
|
||||
contains(Constants.NIGHTLY) || contains(Constants.PRERELEASE) ->
|
||||
Constants.VERSION_NAME +
|
||||
"-${grgitService.service.get().grgit.head().abbreviatedId}"
|
||||
else -> Constants.VERSION_NAME
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,11 +86,15 @@
|
|||
android:name="com.journeyapps.barcodescanner.CaptureActivity"
|
||||
android:screenOrientation="portrait"
|
||||
tools:replace="screenOrientation" />
|
||||
|
||||
<activity
|
||||
android:name=".service.shortcut.ShortcutsActivity"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:finishOnTaskLaunch="true"
|
||||
android:noHistory="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:finishOnTaskLaunch="true"
|
||||
android:launchMode="singleInstance"
|
||||
android:theme="@android:style/Theme.NoDisplay" />
|
||||
|
||||
<service
|
||||
|
@ -174,4 +178,4 @@
|
|||
android:name=".receiver.NotificationActionReceiver"
|
||||
android:exported="false" />
|
||||
</application>
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
object Constants {
|
||||
const val VERSION_NAME = "3.4.8"
|
||||
const val VERSION_NAME = "3.4.8"
|
||||
const val JVM_TARGET = "17"
|
||||
const val VERSION_CODE = 34800
|
||||
const val TARGET_SDK = 34
|
||||
|
@ -14,8 +14,10 @@ object Constants {
|
|||
|
||||
const val RELEASE = "release"
|
||||
const val NIGHTLY = "nightly"
|
||||
const val PRERELEASE = "prerelease"
|
||||
const val DEBUG = "debug"
|
||||
const val TYPE = "type"
|
||||
|
||||
const val NIGHTLY_CODE = 42
|
||||
const val PRERELEASE_CODE = 99
|
||||
}
|
||||
|
|
|
@ -23,10 +23,10 @@ fun Project.getCurrentFlavor(): String {
|
|||
return flavor
|
||||
}
|
||||
|
||||
fun Project.isNightlyBuild(): Boolean {
|
||||
fun Project.getBuildTaskName(): String {
|
||||
val taskRequestsStr = gradle.startParameter.taskRequests[0].toString()
|
||||
return taskRequestsStr.lowercase().contains(Constants.NIGHTLY).also {
|
||||
project.logger.lifecycle("Nightly build: $it")
|
||||
return taskRequestsStr.also {
|
||||
project.logger.lifecycle("Build task: $it")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,10 @@ android {
|
|||
)
|
||||
}
|
||||
|
||||
create(Constants.PRERELEASE) {
|
||||
initWith(getByName(Constants.RELEASE))
|
||||
}
|
||||
|
||||
create(Constants.NIGHTLY) {
|
||||
initWith(getByName(Constants.RELEASE))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue