From 678704e2155bd571cad115f29cc386d39ac38320 Mon Sep 17 00:00:00 2001 From: skyflow-bharti Date: Thu, 16 Jul 2026 19:14:26 +0530 Subject: [PATCH] SK-2967 update internal release workflow --- .github/workflows/internal-release.yml | 4 +-- .github/workflows/shared-build-and-deploy.yml | 28 +++++++------------ 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/internal-release.yml b/.github/workflows/internal-release.yml index 6881618b..70a33281 100644 --- a/.github/workflows/internal-release.yml +++ b/.github/workflows/internal-release.yml @@ -1,4 +1,4 @@ -name: Publish package to the JFROG Artifactory +name: Publish v2 module to the JFROG Artifactory on: push: tags-ignore: @@ -9,7 +9,7 @@ on: - release/* jobs: - build-and-deploy: + build-and-deploy-v2: uses: ./.github/workflows/shared-build-and-deploy.yml with: ref: ${{ github.ref_name }} diff --git a/.github/workflows/shared-build-and-deploy.yml b/.github/workflows/shared-build-and-deploy.yml index cc771fe9..77615306 100644 --- a/.github/workflows/shared-build-and-deploy.yml +++ b/.github/workflows/shared-build-and-deploy.yml @@ -59,19 +59,19 @@ jobs: fetch-depth: 0 - name: Set up maven or jfrog repository - uses: actions/setup-java@v4 + uses: actions/setup-java@v1 with: java-version: "11" distribution: "adopt" server-id: ${{ inputs.server-id }} - server-username: ${{ secrets.server-username }} - server-password: ${{ secrets.server-password }} + server-username: SERVER_USERNAME + server-password: SERVER_PASSWORD gpg-private-key: ${{ secrets.gpg-key }} # Value of the GPG private key to import - gpg-passphrase: ${{ secrets.gpg-passphrase }} # env variable for GPG private key passphrase - + gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase + - name: Resolve Branch for the Tagged Commit id: resolve-branch - if: ${{ inputs.tag == 'beta' || inputs.tag == 'public' }} + if: ${{ inputs.tag == 'beta' || inputs.tag == 'public' }} run: | TAG_COMMIT=$(git rev-list -n 1 ${{ github.ref_name }}) BRANCH_NAME=$(git branch -r --contains $TAG_COMMIT | grep -o 'origin/.*' | sed 's|origin/||' | head -n 1) @@ -89,7 +89,6 @@ jobs: fallback: 1.0.0 - name: Bump Version - id: bump-version run: | chmod +x ./scripts/bump_version.sh if ${{ inputs.tag == 'internal' }}; then @@ -98,13 +97,6 @@ jobs: ./scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}" "" "${{ inputs.module }}" fi - MODULE="${{ inputs.module }}" - if [ -n "$MODULE" ]; then - echo "pom_path=$MODULE/pom.xml" >> "$GITHUB_OUTPUT" - else - echo "pom_path=pom.xml" >> "$GITHUB_OUTPUT" - fi - - name: Commit changes run: | git config user.name ${{ github.actor }} @@ -114,7 +106,7 @@ jobs: git checkout ${{ env.branch_name }} fi - git add ${{ steps.bump-version.outputs.pom_path }} + git add ${{ inputs.module }}/pom.xml if [[ "${{ inputs.tag }}" == "internal" ]]; then git commit -m "[AUTOMATED] Private Release ${{ steps.previoustag.outputs.tag }}-dev-$(git rev-parse --short $GITHUB_SHA)" git push origin ${{ github.ref_name }} -f @@ -142,12 +134,12 @@ jobs: - name: Publish package run: | if [[ "${{ inputs.tag }}" == "internal" ]]; then - mvn --batch-mode -pl ${{ inputs.module }} -am deploy -P jfrog -DskipTests + mvn --batch-mode -pl ${{ inputs.module }} -am deploy -P jfrog -DskipTests elif [[ "${{ inputs.tag }}" == "beta" || "${{ inputs.tag }}" == "public" ]]; then - mvn --batch-mode -pl ${{ inputs.module }} -am deploy -P ${{ inputs.profile }} -DskipTests + mvn --batch-mode -pl ${{ inputs.module }} -am deploy -P ${{ inputs.profile }} fi env: SERVER_USERNAME: ${{ secrets.server-username }} SERVER_PASSWORD: ${{ secrets.server-password }} - GPG_PASSPHRASE: ${{ secrets.gpg-passphrase }} + GPG_PASSPHRASE: ${{ secrets.gpg-passphrase }} \ No newline at end of file