From 7850f37d9cae864ec52a9f4c97472b75e59ecc51 Mon Sep 17 00:00:00 2001 From: rohanshah18 Date: Fri, 23 May 2025 15:52:01 -0400 Subject: [PATCH 1/2] print version only --- .github/workflows/release.yml | 40 ++++++++++++++++------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a7037b47..eae049fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,16 @@ on: - 'patch' # bug fixes - 'minor' # new features, backwards compatible - 'major' # breaking changes - + isPrerelease: + description: 'Whether this is a prerelease' + required: true + type: boolean + default: true + prereleaseSuffix: + description: 'Suffix to add onto the new version number in order to mark it as a prerelease. Value ignored when shipping a release that is not a prerelease.' + required: false + type: string + default: 'rc1' jobs: release: runs-on: ubuntu-latest @@ -54,6 +63,11 @@ jobs: ;; esac + # Append prerelease suffix if isPrerelease is true + if [[ "${{ github.event.inputs.isPrerelease }}" == "true" ]]; then + NEW_VERSION="$NEW_VERSION-${{ github.event.inputs.prereleaseSuffix }}" + fi + # Update gradle.properties sed -i "s/pineconeClientVersion = .*/pineconeClientVersion = $NEW_VERSION/" gradle.properties @@ -63,25 +77,7 @@ jobs: - name: Build with Gradle run: ./gradlew clean build - - name: Publish to Maven Central - env: - ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }} - ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} - ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} - ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} - ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} - run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository - - - name: Create GitHub Release - uses: softprops/action-gh-release@v1 - with: - name: Release v${{ env.NEW_VERSION }} - tag_name: v${{ env.NEW_VERSION }} - body: | - Release v${{ env.NEW_VERSION }} - - This release was created automatically by the release workflow. - draft: false - prerelease: false + - name: Echo New Version + run: echo "New version is $NEW_VERSION" env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + NEW_VERSION: ${{ env.NEW_VERSION }} \ No newline at end of file From 6a82de810f0f0b57a741b79fdc7b45a433200525 Mon Sep 17 00:00:00 2001 From: rohanshah18 Date: Fri, 23 May 2025 16:13:08 -0400 Subject: [PATCH 2/2] add publishing to maven central step --- .github/workflows/release.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eae049fc..482f2afe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,6 +27,7 @@ on: required: false type: string default: 'rc1' + jobs: release: runs-on: ubuntu-latest @@ -80,4 +81,13 @@ jobs: - name: Echo New Version run: echo "New version is $NEW_VERSION" env: - NEW_VERSION: ${{ env.NEW_VERSION }} \ No newline at end of file + NEW_VERSION: ${{ env.NEW_VERSION }} + + - name: Publish to Maven Central + env: + ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }} + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} + ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} + ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} + run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository \ No newline at end of file