Browse Source

Actions: Add option to use the current branch name as the snapshot identifier

pull/245/head
weisj 3 years ago
parent
commit
b1bb5caa10
No known key found for this signature in database
GPG Key ID: 31124CB75461DA2A
  1. 2
      .github/workflows/branch-snapshot.yml
  2. 7
      build.gradle.kts
  3. 1
      gradle.properties
  4. 1
      settings.gradle.kts

2
.github/workflows/branch-snapshot.yml

@ -30,7 +30,7 @@ jobs:
- name: Publish
if: steps.check.outputs.triggered == 'true'
env:
PROPS_RELEASE: "-Prc=1 -Pgh -Prelease=false -PskipJavadoc -PskipAutostyle -PfailIfLibraryMissing -PsnapshotName=${{ github.head_ref }}"
PROPS_RELEASE: "-Prc=1 -Pgh -Prelease=false -PskipJavadoc -PskipAutostyle -PfailIfLibraryMissing -PuseBranchSnapshotName=true"
PROPS_GIT: "-PghGitSourceUsername=${{ secrets.GH_GIT_USERNAME }} -PghGitSourcePassword=${{ secrets.GITHUB_TOKEN }}"
PROPS_NEXUS: "-PghNexusUsername=${{ secrets.GH_NEXUS_USERNAME }} -PghNexusPassword=${{ secrets.GH_NEXUS_PASSWORD }}"
PROPS_SIGNING: "-PuseInMemoryKey=true -Psigning.inMemoryKey=${{ secrets.IN_MEMORY_KEY }} -Psigning.password=${{ secrets.SIGNING_PASSWORD }}"

7
build.gradle.kts

@ -14,6 +14,7 @@ plugins {
id("com.github.vlsi.crlf")
id("com.github.vlsi.gradle-extensions")
id("com.github.vlsi.stage-vote-release")
id("org.ajoberstar.grgit")
}
val skipJavadoc by props()
@ -21,7 +22,11 @@ val enableMavenLocal by props(false)
val enableGradleMetadata by props()
val skipAutostyle by props(false)
val isRelease = project.stringProperty("release").toBool()
val snapshotName by props("")
val snapshotName = if (project.props.bool("useBranchSnapshotName")) {
System.getenv("GITHUB_HEAD_REF") ?: grgit.branch.current()?.name
} else {
project.stringProperty("snapshotName")
} ?: ""
val String.v: String get() = rootProject.extra["$this.version"] as String
val projectVersion = "darklaf".v

1
gradle.properties

@ -14,3 +14,4 @@ darklaf.version = 2.6.2
com.github.vlsi.vlsi-release-plugins.version = 1.74
com.github.autostyle.version = 3.1
nokee.version = 0.4.0
org.ajoberstar.grgit.version = 4.1.0

1
settings.gradle.kts

@ -10,6 +10,7 @@ pluginManagement {
idv("com.github.vlsi.gradle-extensions", "com.github.vlsi.vlsi-release-plugins")
idv("com.github.vlsi.license-gather", "com.github.vlsi.vlsi-release-plugins")
idv("com.github.vlsi.stage-vote-release", "com.github.vlsi.vlsi-release-plugins")
idv("org.ajoberstar.grgit", "org.ajoberstar.grgit")
}
}
rootProject.name = "darklaf"

Loading…
Cancel
Save