diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index e75dd976f4..eecf66f0e2 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -29,8 +29,12 @@ jobs: - name: Build with Gradle run: ./gradlew assembleRelease --no-daemon -PnoProguard + - name: Get commit hash + id: get_commit_hash + run: echo "::set-output name=hash::$(git rev-parse --short HEAD)" + - name: Upload build uses: actions/upload-artifact@v3 with: - name: revanced-manager + name: revanced-manager-${{ steps.get_commit_hash.outputs.hash }} path: app/build/outputs/apk/release/*.apk diff --git a/.releaserc b/.releaserc index 3583332b20..60709d25ce 100644 --- a/.releaserc +++ b/.releaserc @@ -30,7 +30,7 @@ { "assets": [ { - "path": "app/build/outputs/apk/release/*.apk" + "path": "app/build/outputs/apk/release/revanced-manager*.apk" } ], "successComment": false diff --git a/app/build.gradle.kts b/app/build.gradle.kts index cf7a58ce28..d6a32aee2f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -33,7 +33,6 @@ android { release { val hasReleaseConfig = (System.getenv("KEYSTORE_FILE") != null) - var suffix = "v${project.version}" if (hasReleaseConfig) { signingConfigs { create("release") { @@ -44,29 +43,23 @@ android { } } signingConfig = signingConfigs.getByName("release") + applicationVariants.all { + this.outputs + .map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl } + .forEach { output -> + output.outputFileName = "revanced-manager-v${project.version}.apk" + } + } } else { applicationIdSuffix = ".debug" resValue("string", "app_name", "ReVanced Manager Debug") signingConfig = signingConfigs.getByName("debug") - val os = org.apache.commons.io.output.ByteArrayOutputStream() - project.exec { - commandLine = "git rev-parse --short HEAD".split(" ") - standardOutput = os - } - suffix = String(os.toByteArray()).trim() } if (!project.hasProperty("noProguard")) { isMinifyEnabled = true isShrinkResources = true proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } - applicationVariants.all { - this.outputs - .map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl } - .forEach { output -> - output.outputFileName = "revanced-manager-${suffix}.apk" - } - } } }