From 6b301c2ca389a10dfab988bbdca4afbe71447807 Mon Sep 17 00:00:00 2001 From: Ryan Dens Date: Thu, 12 Dec 2024 09:11:20 -0800 Subject: [PATCH] :recycle: refactor release flow to publish artifacts to github release --- .github/workflows/publish.yml | 23 ++++++++++------------- build.gradle.kts | 1 - 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f5e611c..0ac172c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,9 +1,10 @@ name: Create Release on Semantic Version Tag on: - push: - tags: - - "v*" + workflow_dispatch: + inputs: + version: + description: a stable version to use (e.g. 1.2.1) jobs: release: @@ -24,7 +25,11 @@ jobs: uses: gradle/gradle-build-action@v2 - name: Execute Gradle build - run: ./gradlew build + run: ./gradlew -Pversion=${{ inputs.version }} build publishToMavenLocal + env: + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSPHRASE }} + - name: "Create release" uses: "marvinpinto/action-automatic-releases@latest" @@ -32,12 +37,4 @@ jobs: repo_token: "${{ secrets.GITHUB_TOKEN }}" prerelease: false files: | - build/libs/java-security-*.jar - - - name: "Publish to Maven Central" - run: ./gradlew publishNebulaPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository - env: - ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }} - ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSPHRASE }} - ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }} - ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_TOKEN }} + ~/.m2/repository/io/github/pixee/java-security-toolkit/${{ inputs.version }}/java-security-* diff --git a/build.gradle.kts b/build.gradle.kts index 593f4be..4564a75 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -91,7 +91,6 @@ tasks.named(java11SourceSet.jarTaskName) { } group = "io.github.pixee" -version = "1.2.1" description = "java-security-toolkit"