diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml new file mode 100644 index 00000000..c723914a --- /dev/null +++ b/.github/workflows/beta-release.yml @@ -0,0 +1,20 @@ +name: Public beta release +on: + push: + tags: '*.*.*-beta.*' +jobs: + build-and-deploy: + uses: ./.github/workflows/shared-build-and-deploy.yml + with: + ref: ${{ github.ref_name }} + 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..f87afc29 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" @@ -13,9 +14,9 @@ jobs: uses: ./.github/workflows/shared-build-and-deploy.yml with: ref: ${{ github.ref_name }} - 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..855b7b4c 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: '*.*.*' @@ -7,9 +7,9 @@ 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' 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..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 @@ -21,6 +16,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 +49,6 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: ${{ inputs.ref }} fetch-depth: 0 - name: Set up maven or jfrog repository @@ -72,27 +71,29 @@ 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 }}" 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 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