diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 6bd231cd..9ec63ca0 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -17,6 +17,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Get commit hash + id: get_commit_hash + run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Set up JDK 17 uses: actions/setup-java@v4 with: @@ -27,14 +31,10 @@ jobs: uses: gradle/gradle-build-action@v2 - name: Build with Gradle - run: ./gradlew assembleRelease --no-daemon -PnoProguard - - - name: Get commit hash - id: get_commit_hash - run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + run: ./gradlew assembleRelease --no-daemon -PnoProguard -Psuffix=${{ steps.get_commit_hash.outputs.hash }} - name: Upload build uses: actions/upload-artifact@v3 with: - name: revanced-manager-${{ steps.get_commit_hash.outputs.hash }}.apk + name: revanced-manager-${{ steps.get_commit_hash.outputs.hash }} path: app/build/outputs/apk/release/*.apk diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 122a4b42..1a5c5041 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -48,5 +48,5 @@ jobs: keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }} keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} run: | - echo "${{ secrets.SIGNING_KEYSTORE }}" | base64 --decode > keystore.jks + echo "${{ secrets.SIGNING_KEYSTORE }}" | base64 --decode > app/keystore.jks npx semantic-release diff --git a/app/build.gradle.kts b/app/build.gradle.kts index bf75f802..a156bbb6 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -42,13 +42,6 @@ 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") @@ -59,6 +52,17 @@ android { isShrinkResources = true proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } + var suffix = "v${project.version}" + if (project.hasProperty("suffix")) { + suffix = "${project.property("suffix")}" + } + applicationVariants.all { + this.outputs + .map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl } + .forEach { output -> + output.outputFileName = "revanced-manager-${suffix}.apk" + } + } } }