mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
chore(workflow): fix: provide dummy version name for test jobs
This commit is contained in:
@@ -110,6 +110,7 @@ jobs:
|
||||
- name: Run debug tests
|
||||
run: ./gradlew testDebug --continue
|
||||
env:
|
||||
ANDROIDIDE_TEST: true
|
||||
IDE_SIGNING_ALIAS: ${{ secrets.IDE_SIGNING_ALIAS }}
|
||||
IDE_SIGNING_AUTH_PASS: ${{ secrets.IDE_SIGNING_AUTH_PASS }}
|
||||
IDE_SIGNING_AUTH_USER: ${{ secrets.IDE_SIGNING_AUTH_USER }}
|
||||
@@ -148,6 +149,7 @@ jobs:
|
||||
- name: Run Tooling API tests
|
||||
run: ./gradlew clean :subprojects:tooling-api-impl:build
|
||||
env:
|
||||
ANDROIDIDE_TEST: true
|
||||
TEST_TOOLING_API_IMPL: "true"
|
||||
IDE_SIGNING_ALIAS: ${{ secrets.IDE_SIGNING_ALIAS }}
|
||||
IDE_SIGNING_AUTH_PASS: ${{ secrets.IDE_SIGNING_AUTH_PASS }}
|
||||
@@ -231,4 +233,4 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Publish release
|
||||
run: ./gradlew publishAllPublicationsToMavenCentralRepository --stacktrace
|
||||
run: ./gradlew publishAllPublicationsToMavenCentralRepository --stacktrace
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import org.gradle.kotlin.dsl.provideDelegate
|
||||
import java.io.File
|
||||
import org.gradle.kotlin.dsl.provideDelegate
|
||||
|
||||
/**
|
||||
* Information about the CI build.
|
||||
@@ -39,6 +39,9 @@ object CI {
|
||||
/** Whether the current build is a CI build. */
|
||||
val isCiBuild by lazy { "true" == System.getenv("CI") }
|
||||
|
||||
/** Whether the current build is for tests. This is set ONLY in CI builds. */
|
||||
val isTestEnv by lazy { "true" == System.getenv("ANDROIDIDE_TEST") }
|
||||
|
||||
private fun shortSha(sha: String): String {
|
||||
return ProcessBuilder("git", "rev-parse", "--short", sha)
|
||||
.directory(File("."))
|
||||
|
||||
+10
-4
@@ -51,9 +51,15 @@ val Project.simpleVersionName: String by lazy {
|
||||
return@lazy regex.find(version)?.value?.substring(1)?.also {
|
||||
logger.warn("Simple version name is '$it' (from version $version)")
|
||||
}
|
||||
?: throw IllegalStateException(
|
||||
"Invalid version string '$version'. Version names must be SEMVER with 'v' prefix"
|
||||
)
|
||||
?: run {
|
||||
if (CI.isTestEnv) {
|
||||
return@run "1.0.0-beta"
|
||||
}
|
||||
|
||||
throw IllegalStateException(
|
||||
"Cannot extract simple version name. Invalid version string '$version'. Version names must be SEMVER with 'v' prefix"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
val Project.projectVersionCode: Int by lazy {
|
||||
@@ -64,7 +70,7 @@ val Project.projectVersionCode: Int by lazy {
|
||||
logger.warn("Version code is '$it' (from version ${version}).")
|
||||
}
|
||||
?: throw IllegalStateException(
|
||||
"Invalid version string '$version'. Version names must be SEMVER with 'v' prefix"
|
||||
"Cannot extract version code. Invalid version string '$version'. Version names must be SEMVER with 'v' prefix"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user