From 6babf9e21a1ef7e3f61331f59af1a063295bbe3a Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:50:08 -0400 Subject: [PATCH] BRE-367 - Update regex in Publish Java workflow (#1143) --- .github/workflows/publish-java.yml | 4 ++-- languages/java/build.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-java.yml b/.github/workflows/publish-java.yml index c6266a1a9..7f461c198 100644 --- a/.github/workflows/publish-java.yml +++ b/.github/workflows/publish-java.yml @@ -51,8 +51,8 @@ jobs: id: version-output run: | if [[ "${{ inputs.version }}" == "latest" || "${{ inputs.version }}" == "" ]]; then - TAG_NAME=$(curl "https://api.github.com/repos/bitwarden/sdk/releases" | jq -c '.[] | select(.tag_name | contains("java")) | .tag_name' | head -1) - VERSION=$(echo $TAG_NAME | grep -ohE '20[0-9]{2}\.([1-9]|1[0-2])\.[0-9]+') + TAG_NAME=$(curl "https://api.github.com/repos/bitwarden/sdk/releases" | jq -rc '.[] | select(.tag_name | contains("java")) | .tag_name' | head -1) + VERSION=$(echo $TAG_NAME | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') echo "Latest Released Version: $VERSION" echo "version=$VERSION" >> $GITHUB_OUTPUT diff --git a/languages/java/build.gradle b/languages/java/build.gradle index b9789d199..a28a7445b 100644 --- a/languages/java/build.gradle +++ b/languages/java/build.gradle @@ -35,7 +35,7 @@ repositories { def branchName = "git branch --show-current".execute().text.trim() - if (branchName == "main" || branchName == "rc" || branchName == "hotfix-rc") { + if (branchName == "main") { version = "1.0.1" } else { // branchName-SNAPSHOT