Skip to content

Commit fd9afe8

Browse files
committed
Compute project version from Git
1 parent e56d74f commit fd9afe8

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/continuous-integration.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ jobs:
7474

7575
steps:
7676
- uses: actions/checkout@v2
77+
with:
78+
fetch-depth: 0 # Fetch history and tags; necessary for computing project version.
7779
- name: Set up JDK ${{ env.JDK_VERSION }}
7880
uses: actions/setup-java@v2
7981
with:

build.gradle.kts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ plugins {
55
`java-library`
66
`maven-publish`
77

8+
// Versioning
9+
id("pl.allegro.tech.build.axion-release") version "1.13.6"
10+
811
// Style checking
912
id("com.diffplug.spotless") version "6.2.2"
1013

@@ -17,10 +20,9 @@ plugins {
1720

1821
group = "io.github.apl-cornell"
1922

20-
// Compute version from GitHub tag if available
21-
System.getenv("GITHUB_REF")?.substringAfterLast('/')?.let { gitTag ->
22-
version = gitTag
23-
}
23+
// Compute version from source control
24+
scmVersion.tag.prefix = ""
25+
version = scmVersion.version
2426

2527
/** Java Version */
2628

0 commit comments

Comments
 (0)