From d050f961bff73fb4b8641365f600443c21b92aca Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Mon, 14 Oct 2024 11:28:29 -0400 Subject: [PATCH 1/4] Add fixed regex --- .github/workflows/publish-java.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-java.yml b/.github/workflows/publish-java.yml index 002a61ee4..f3e3e9a86 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 From dbb441730f8b7303a50f1a9fd1ff9a27726e432c Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Mon, 14 Oct 2024 11:28:45 -0400 Subject: [PATCH 2/4] Comment out branch check for testing --- .github/workflows/publish-java.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-java.yml b/.github/workflows/publish-java.yml index f3e3e9a86..da46d3930 100644 --- a/.github/workflows/publish-java.yml +++ b/.github/workflows/publish-java.yml @@ -37,15 +37,15 @@ jobs: - name: Checkout repo uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - name: Branch check - if: ${{ inputs.release_type != 'Dry Run' }} - run: | - if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - echo "===================================" - echo "[!] Can only release from the 'main' branch" - echo "===================================" - exit 1 - fi + # - name: Branch check + # if: ${{ inputs.release_type != 'Dry Run' }} + # run: | + # if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then + # echo "===================================" + # echo "[!] Can only release from the 'main' branch" + # echo "===================================" + # exit 1 + # fi - name: Version output id: version-output From 8a28fa1df52bdbe516989b7745a46e8ccc61507a Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:25:05 -0400 Subject: [PATCH 3/4] Uncomment branch check --- .github/workflows/publish-java.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-java.yml b/.github/workflows/publish-java.yml index da46d3930..f3e3e9a86 100644 --- a/.github/workflows/publish-java.yml +++ b/.github/workflows/publish-java.yml @@ -37,15 +37,15 @@ jobs: - name: Checkout repo uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - # - name: Branch check - # if: ${{ inputs.release_type != 'Dry Run' }} - # run: | - # if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then - # echo "===================================" - # echo "[!] Can only release from the 'main' branch" - # echo "===================================" - # exit 1 - # fi + - name: Branch check + if: ${{ inputs.release_type != 'Dry Run' }} + run: | + if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then + echo "===================================" + echo "[!] Can only release from the 'main' branch" + echo "===================================" + exit 1 + fi - name: Version output id: version-output From 0f2a6e021c1b0afb995dff9a3e457b2497fe0a66 Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:25:03 -0400 Subject: [PATCH 4/4] Remove rc branches --- languages/java/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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