ソースを参照

buildSrc: Use HEAD rev count as version code

In Actions, we do not always have a checkout of the master branch.

This only applies to release builds anyway. For debug builds, we always
use the timestamp.
Peter Cai 1 年間 前
コミット
8ee3c53492

+ 1 - 1
buildSrc/src/main/kotlin/im/angry/openeuicc/build/Versioning.kt

@@ -12,7 +12,7 @@ val Project.gitVersionCode: Int
         try {
             val stdout = ByteArrayOutputStream()
             exec {
-                commandLine("git", "rev-list", "--first-parent", "--count", "master")
+                commandLine("git", "rev-list", "--first-parent", "--count", "HEAD")
                 standardOutput = stdout
             }
             stdout.toString("utf-8").trim('\n').toInt()