Skip to content

Commit

Permalink
Update versioning and publication process
Browse files Browse the repository at this point in the history
Added GitHub run number to versioning in `build.gradle.kts` for unique build identification. Adjusted GitHub Actions workflow to include the build step within the publish command and set the `GITHUB_BUILD_NUMBER` environment variable.
  • Loading branch information
ThePandaOliver committed Aug 23, 2024
1 parent da0801f commit 07f0b39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ jobs:
- name: Grant execute permission for Gradlew
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew build

- name: Publish to GitHub Packages
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_BUILD_NUMBER: ${{ github.run_number }}
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ subprojects {
artifactId = "${projectArchivesName}-${project.name}"
version = project.version as String

val buildNumber = System.getenv("GITHUB_BUILD_NUMBER")
if (buildNumber != null) {
version = "$version-$buildNumber"
}

from(components["java"])
}
}
Expand Down

0 comments on commit 07f0b39

Please sign in to comment.