From f4f4485b349a2a1848c6db18c6d127d22cc97578 Mon Sep 17 00:00:00 2001 From: skyflow-shravan Date: Wed, 15 Jan 2025 13:07:35 +0530 Subject: [PATCH 1/4] SK-1815 workflow for beta release --- .github/workflows/beta-release.yml | 21 +++++++++++++++++++ .github/workflows/internal-release.yml | 4 +++- .github/workflows/release.yml | 1 + .github/workflows/shared-build-and-deploy.yml | 7 ++++++- 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/beta-release.yml diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml new file mode 100644 index 00000000..d0ffbcdf --- /dev/null +++ b/.github/workflows/beta-release.yml @@ -0,0 +1,21 @@ +name: Publish package to the Maven Central Repository +on: + push: + tags: '*.*.*-beta.*' +jobs: + build-and-deploy: + uses: ./.github/workflows/shared-build-and-deploy.yml + with: + ref: ${{ github.ref_name }} + is-internal: false + server-id: ossrh + profile: maven-central + tag: 'beta' + secrets: + server-username: ${{ secrets.OSSRH_USERNAME }} + server-password: ${{ secrets.OSSRH_PASSWORD }} + gpg-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + skyflow-credentials: ${{ secrets.SKYFLOW_CREDENTIALS }} >> .env + test-expired-token: ${{ secrets.TEST_EXPIRED_TOKEN }} >> .env + test-reusable-token: ${{ secrets.TEST_REUSABLE_TOKEN }} >> .env diff --git a/.github/workflows/internal-release.yml b/.github/workflows/internal-release.yml index 6aea0e52..5b8c1668 100644 --- a/.github/workflows/internal-release.yml +++ b/.github/workflows/internal-release.yml @@ -1,7 +1,8 @@ name: Publish package to the JFROG Artifactory on: push: - tags: '*.*.*' + tags-ignore: + - '*.*' paths-ignore: - "pom.xml" - "*.md" @@ -16,6 +17,7 @@ jobs: is-internal: true server-id: central profile: jfrog + tag: 'internal' secrets: server-username: ${{ secrets.ARTIFACTORY_USERNAME }} server-password: ${{ secrets.ARTIFACTORY_PASSWORD }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a4c7bfd9..16d8d93c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,7 @@ jobs: is-internal: false server-id: ossrh profile: maven-central + tag: 'public' secrets: server-username: ${{ secrets.OSSRH_USERNAME }} server-password: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/shared-build-and-deploy.yml b/.github/workflows/shared-build-and-deploy.yml index 4bd80367..3e32527e 100644 --- a/.github/workflows/shared-build-and-deploy.yml +++ b/.github/workflows/shared-build-and-deploy.yml @@ -21,6 +21,11 @@ on: description: "Profile to pick from pom.xml" required: true type: string + + tag: + description: 'Release Tag' + required: true + type: string secrets: server-username: required: true @@ -49,7 +54,6 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: ${{ inputs.ref }} fetch-depth: 0 - name: Set up maven or jfrog repository @@ -79,6 +83,7 @@ jobs: fi - name: Commit changes + if: ${{ inputs.tag == 'internal' || inputs.tag == 'public' }} run: | git config user.name ${{ github.actor }} git config user.email ${{ github.actor }}@users.noreply.github.com From 2bdc1a5be70b205a9aef9ff3bf27da5aed590ec9 Mon Sep 17 00:00:00 2001 From: skyflow-shravan Date: Wed, 15 Jan 2025 13:19:31 +0530 Subject: [PATCH 2/4] SK-1815 workflow for beta release --- .github/workflows/beta-release.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index d0ffbcdf..53107c6e 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -1,4 +1,4 @@ -name: Publish package to the Maven Central Repository +name: Public beta release on: push: tags: '*.*.*-beta.*' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 16d8d93c..35e1dda8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Publish package to the Maven Central Repository +name: Public release on: push: tags: '*.*.*' From 62cd8e9723ef5b1c395a140d44b5b3679bc8558d Mon Sep 17 00:00:00 2001 From: skyflow-shravan Date: Wed, 15 Jan 2025 13:29:16 +0530 Subject: [PATCH 3/4] SK-1815 workflow for beta release --- .github/workflows/internal-release.yml | 1 - .github/workflows/release.yml | 1 - .github/workflows/shared-build-and-deploy.yml | 14 +++++--------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/internal-release.yml b/.github/workflows/internal-release.yml index 5b8c1668..f87afc29 100644 --- a/.github/workflows/internal-release.yml +++ b/.github/workflows/internal-release.yml @@ -14,7 +14,6 @@ jobs: uses: ./.github/workflows/shared-build-and-deploy.yml with: ref: ${{ github.ref_name }} - is-internal: true server-id: central profile: jfrog tag: 'internal' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35e1dda8..855b7b4c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,6 @@ jobs: uses: ./.github/workflows/shared-build-and-deploy.yml with: ref: ${{ github.ref_name }} - is-internal: false server-id: ossrh profile: maven-central tag: 'public' diff --git a/.github/workflows/shared-build-and-deploy.yml b/.github/workflows/shared-build-and-deploy.yml index 3e32527e..28b4d01f 100644 --- a/.github/workflows/shared-build-and-deploy.yml +++ b/.github/workflows/shared-build-and-deploy.yml @@ -7,11 +7,6 @@ on: required: true type: string - is-internal: - description: "Flag for internal release" - required: true - type: boolean - server-id: description: "Id of the repository" required: true @@ -76,7 +71,7 @@ jobs: - name: Bump Version run: | chmod +x ./scripts/bump_version.sh - if ${{ inputs.is-internal }}; then + if ${{ inputs.tag == 'internal' }}; then ./scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}" "$(git rev-parse --short "$GITHUB_SHA")" else ./scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}" @@ -88,16 +83,17 @@ jobs: git config user.name ${{ github.actor }} git config user.email ${{ github.actor }}@users.noreply.github.com git add pom.xml - if ${{ inputs.is-internal }}; then + 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 - else + fi + if ${{ inputs.tag == 'public' }}; then git commit -m "[AUTOMATED] Public Release - ${{ steps.previoustag.outputs.tag }}" git push origin fi - name: Create env - if: ${{ inputs.is-internal }} + if: ${{ inputs.tag == 'internal' }} id: create-env run: | touch .env From 80c55099d86cb03e35a4996af18749205fc227af Mon Sep 17 00:00:00 2001 From: skyflow-shravan Date: Wed, 15 Jan 2025 13:30:26 +0530 Subject: [PATCH 4/4] SK-1815 workflow for beta release --- .github/workflows/beta-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index 53107c6e..c723914a 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -7,7 +7,6 @@ jobs: uses: ./.github/workflows/shared-build-and-deploy.yml with: ref: ${{ github.ref_name }} - is-internal: false server-id: ossrh profile: maven-central tag: 'beta'