Triple-T / gradle-play-publisher

GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
MIT License
4.1k stars 340 forks source link

publishBundle task with --artifact-dir in CLI starts build instead of publishing existing artifact #1017

Closed Thomas9292 closed 2 years ago

Thomas9292 commented 2 years ago

Describe the bug

publishBundle with --artifact-dir starts build instead of publishing existing bundle, unless artifact-dir is specified in build.gradle

How To Reproduce

See 'Tasks executed'

Versions

Tasks executed

Does not work:

./gradlew app:publishBundle --artifact-dir $(PRODUCTION_RELEASE_DIR)/ --stacktrace

Does work:

./gradlew app:publishBundle --stacktrace

with in build.gradle:

apply plugin: 'com.github.triplet.play'
play {
    serviceAccountCredentials = file("service-account.json")
    track = "internal"
    artifactDir = file("/Users/runner/work/1/s/artifact-download/android_production/app-production-release.aab")
}

Expected behavior

For the plugin to publish the existing .aab to Google play, regardless of setting the --artifact-dir through CLI or in build.gradle.

Additional context (if a crash, provide stack trace)

Since the task is ran from a pipeline, setting the artifiact directory through the CLI is strongly preferable over setting it in the build.gradle.

Following issue #649 I checked my project for dependsOn and tasks.all or tasks.onEach, none of which are present in this project.

SUPERCILEX commented 2 years ago

That should be fixed waaaay back in v2.7. Please use the latest version (3.x ideally) and see if the issue persists.

Thomas9292 commented 2 years ago

This fixed it, thanks