From b64f00df376ecd27668b3c6ce8d814c90c3d7381 Mon Sep 17 00:00:00 2001 From: ankitkumar Date: Fri, 26 Jan 2024 18:00:39 +0530 Subject: [PATCH] added action --- .github/workflows/publish.yml | 31 +++++++++++++++++++++++++++++++ gradle/publish-package.gradle | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..013d115 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish + +on: + release: + types: [ created ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Check + run: ./gradlew check --stacktrace + + - name: Publish Artifact + run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --max-workers=1 --stacktrace + env: + RELEASE_TAG_NAME: ${{ github.event.release.tag_name }} + OSS_USERNAME: ${{ secrets.OSS_USERNAME }} + OSS_PASSWORD: ${{ secrets.OSS_PASSWORD }} + OSS_STAGING_PROFILE_ID: ${{ secrets.OSS_STAGING_PROFILE_ID }} + OSS_SIGNING_KEY_ID: ${{ secrets.OSS_SIGNING_KEY_ID }} + OSS_SIGNING_PASSWORD: ${{ secrets.OSS_SIGNING_PASSWORD }} + OSS_SIGNING_KEY: ${{ secrets.OSS_SIGNING_KEY }} \ No newline at end of file diff --git a/gradle/publish-package.gradle b/gradle/publish-package.gradle index ce0c18d..a81cc47 100644 --- a/gradle/publish-package.gradle +++ b/gradle/publish-package.gradle @@ -3,7 +3,7 @@ apply plugin: 'signing' ext { GROUP_ID = "io.github.pseudoankit" - VERSION = "1.0.4" + VERSION = (System.getenv("RELEASE_TAG_NAME") ?: "SNAPSHOT").replace("v", "") SITE_URL = 'https://github.com/pseudoankit/coachmark' GIT_URL = 'https://github.com/pseudoankit/coachmark.git'