Skip to content

Commit

Permalink
Updated build again
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminHalko committed Jan 23, 2024
1 parent 1974659 commit d047ae9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{
"assets": [
{
"path": "app/build/outputs/apk/release/*.apk"
"path": "app/build/outputs/apk/release/revanced-manager*.apk"
}
],
"successComment": false
Expand Down
21 changes: 7 additions & 14 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ android {

release {
val hasReleaseConfig = (System.getenv("KEYSTORE_FILE") != null)
var suffix = "v${project.version}"
if (hasReleaseConfig) {
signingConfigs {
create("release") {
Expand All @@ -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"
}
}
}
}

Expand Down

0 comments on commit d047ae9

Please sign in to comment.