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