Skip to content

Commit

Permalink
build: Reintroduce jgitver (#7)
Browse files Browse the repository at this point in the history
* build: Revert gradle-semver-plugin changes

This reverts commit c6ec061.

* ci: refetch tags again in release
  • Loading branch information
usmansaleem committed Jul 5, 2024
1 parent c6ec061 commit fcb7872
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --tags --force origin #workaround https://github.com/actions/checkout/issues/882
- name: Set up Java
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/upload-dependency-graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: temurin
Expand Down
12 changes: 3 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,12 @@ import org.jreleaser.model.UpdateSection
plugins {
`java-library`
alias(libs.plugins.spotless)
alias(libs.plugins.gradle.semver)
alias(libs.plugins.jgitver)
alias(libs.plugins.jreleaser)
}

semver {
tagPrefix("v")
initialVersion("0.0.0")
findProperty("semver.overrideVersion")?.toString()?.let { overrideVersion(it) }
}

project.group = "info.usmans.tools"

version = semver.version // project version, also used for jreleaser

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
Expand Down Expand Up @@ -53,6 +45,8 @@ spotless {
kotlinGradle { ktfmt() }
}

jgitver { nonQualifierBranches = "main" }

tasks.register("printVersion") {
group = "Help"
description = "Prints the project version"
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ junit-jupiter = "5.10.2"
spotless = "6.25.0"
slf4j = "2.0.13"
bouncy-castle = "1.78.1"
jgitver = "0.10.0-rc03"
jreleaser = "1.13.1"
figure-gradle-semver = "1.10.0"

[libraries]
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
Expand All @@ -19,5 +19,5 @@ bcprov = { module = "org.bouncycastle:bcprov-jdk18on", version.ref = "bouncy-cas

[plugins]
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
gradle-semver = { id = "com.figure.gradle.semver-plugin", version.ref = "figure-gradle-semver" }
jgitver = { id = "fr.brouillard.oss.gradle.jgitver", version.ref = "jgitver" }
jreleaser = { id = "org.jreleaser", version.ref = "jreleaser"}

0 comments on commit fcb7872

Please sign in to comment.