From e9b2fe0381afc2a1c36917d945190eb83a30a832 Mon Sep 17 00:00:00 2001 From: Sergey Polischuk Date: Sat, 26 Oct 2024 09:23:24 +0300 Subject: [PATCH] changed publication for publishing two version: first version with index and second version snapshot --- .github/workflows/deploy.yml | 10 ++++++++-- build.gradle | 16 +++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 44fe73e3..9da0ddc8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,8 +20,14 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 - - name: Publish package - run: ./gradlew publish + - name: Publish stable version + run: ./gradlew publishStablePublicationToMavenRepository + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + + - name: Publish SNAPSHOT version + run: ./gradlew publishSnapshotPublicationToMavenRepository env: MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} diff --git a/build.gradle b/build.gradle index ad135b9d..9f1ca38c 100644 --- a/build.gradle +++ b/build.gradle @@ -7,9 +7,12 @@ plugins { } group 'org.hyperskill' -version '12.0.0' +version '12.0.1' -sourceCompatibility = 21 +java { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 +} repositories { mavenCentral() @@ -76,7 +79,14 @@ task createFatJar(type: Jar) { publishing { publications { - maven(MavenPublication) { + stable(MavenPublication) { + groupId = "com.github.hyperskill" + artifactId = "hs-test" + version = project.version + from components.java + } + + snapshot(MavenPublication) { groupId = "com.github.hyperskill" artifactId = "hs-test" version = "release-SNAPSHOT"