Skip to content

Commit

Permalink
Build snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
mettok committed Jun 28, 2024
1 parent a60d3a9 commit 13de1b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ jobs:

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Ensure Gradle Wrapper is Downloaded
run: ./gradlew --version

- name: Get Version
run: |
echo "CURRENT_VERSION=$(./gradlew :printVersion --quiet)"
echo "CURRENT_VERSION=$(./gradlew :printVersion --quiet)" >> $GITHUB_ENV
run: echo "CURRENT_VERSION=$(./gradlew :printVersion --quiet)" >> $GITHUB_ENV

- name: Print Project Version
run: echo "Project version is ${{ env.CURRENT_VERSION }}"

- name: Publish artifact
if: ${{ endsWith(env.CURRENT_VERSION, '-SNAPSHOT') }}
run: ./gradlew publish
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repositories {
}

tasks.register("printVersion") {
printVersion()
println(project.version)
}

publishing {
Expand Down Expand Up @@ -80,4 +80,4 @@ fun RepositoryHandler.mavenNav(repo: String): MavenArtifactRepository {
}
}
}
fun printVersion() = println(version)

0 comments on commit 13de1b8

Please sign in to comment.