Skip to content

Commit

Permalink
ci: remove build numbers from snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
xEricL committed Dec 6, 2024
1 parent 0d1f773 commit 0005ab9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
cache-disabled: false

- name: "Build artifacts"
run: ./gradlew build -Pversion_pre_release=${{ github.run_number }} --full-stacktrace
run: ./gradlew build -Psnapshot=true --full-stacktrace

- name: "Publish artifacts"
run: ./gradlew publish -Pversion_pre_release=${{ github.run_number }}
run: ./gradlew publish -Psnapshot=true --full-stacktrace
env:
ALPINE_MAVEN_NAME: ${{ secrets.ALPINE_MAVEN_NAME }}
ALPINE_MAVEN_SECRET: ${{ secrets.ALPINE_MAVEN_SECRET }}
9 changes: 4 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ publishing {
repositories {
maven {
name = "AlpineCloud"
url = uri("https://lib.alpn.cloud" + if (isRelease()) "/alpine-public" else "/snapshots")
url = uri("https://lib.alpn.cloud" + if (isSnapshot()) "/snapshots" else "/alpine-public")
credentials {
username = System.getenv("ALPINE_MAVEN_NAME")
password = System.getenv("ALPINE_MAVEN_SECRET")
Expand Down Expand Up @@ -224,8 +224,8 @@ subprojects {
}
}

fun isRelease(): Boolean {
return project.properties["version_pre_release"] == null
fun isSnapshot(): Boolean {
return (project.findProperty("snapshot") as? String)?.toBoolean() ?: false
}

fun compileGroup(): String {
Expand All @@ -236,8 +236,7 @@ fun compileVersion(): String {
val major = project.properties["version_major"]
val minor = project.properties["version_minor"]
val patch = project.properties["version_patch"]
val preRelease = project.properties["version_pre_release"]
return "${major}.${minor}.${patch}${if (isRelease()) "" else "-SNAPSHOT-${preRelease}"}"
return "${major}.${minor}.${patch}${if (isSnapshot()) "-SNAPSHOT" else ""}"
}

fun shade(scope: DependencyHandlerScope, dependency: String) {
Expand Down

0 comments on commit 0005ab9

Please sign in to comment.