Skip to content

Commit c4b8202

Browse files
committed
feat: provide build number for versioning
1 parent 92c8c92 commit c4b8202

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ jobs:
3434

3535
- name: Upload to maven
3636
env:
37+
CI: true
38+
BUILD_NUMBER: ${{ github.run_number }}
3739
GITHUB_TOKEN: ${{ secrets.PACKAGE_SECRET }}
38-
GITHUB_USERNAME: ${{ github.actor }}
40+
GITHUB_USERNAME: ${{ github.repository_owner }}
3941
GITHUB_REPOSITORY: ${{ github.repository }}
4042
run:
41-
./gradlew publish --no-daemon --no-parallel --stacktrace --info
43+
./gradlew publish

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = 'pt.supercrafting.menu'
7-
version = '1.0-SNAPSHOT'
7+
version = '1.0'
88

99
java {
1010
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
@@ -35,11 +35,12 @@ test {
3535

3636
publishing {
3737

38+
String buildNumber = System.getenv('GITHUB_RUN_NUMBER');
3839
publications {
3940
maven(MavenPublication) {
4041
groupId = project.group
4142
artifactId = 'menu-api'
42-
version = project.version
43+
version = project.version + (buildNumber ? "-${buildNumber}" : '')
4344

4445
from components.java
4546
}

0 commit comments

Comments
 (0)