From 45e4d6892f0f0671589a5d4dd68c91f02d174a84 Mon Sep 17 00:00:00 2001 From: Pallavi Sontakke Date: Tue, 14 Jan 2025 18:48:26 +0530 Subject: [PATCH] Merge workflows into a single one for minor release. For better understanding: - Edit names of steps in the workflow - Edit branch names in the script --- .../create_minor_release_branch.yaml | 32 ------------------- ...ease_PR_commit.yaml => minor_release.yaml} | 22 ++++++++++--- .../release/create_minor_release_PR_commit.sh | 4 +-- 3 files changed, 20 insertions(+), 38 deletions(-) delete mode 100644 .github/workflows/create_minor_release_branch.yaml rename .github/workflows/{create_minor_release_PR_commit.yaml => minor_release.yaml} (51%) diff --git a/.github/workflows/create_minor_release_branch.yaml b/.github/workflows/create_minor_release_branch.yaml deleted file mode 100644 index 55b47d1998c..00000000000 --- a/.github/workflows/create_minor_release_branch.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: Create minor release branch -on: - workflow_dispatch: - -# The workflow needs the permission to push branches -permissions: - contents: write - -jobs: - create-minor-release-branch: - name: Create minor release branch - runs-on: ubuntu-latest - - steps: - - name: Install Linux Dependencies - run: | - sudo apt-get update - sudo apt-get install pip - - - name: Install Python Dependencies - run: | - pip install PyGithub requests - - - name: Checkout TimescaleDB - uses: actions/checkout@v4 - - - name: Run the minor-release branch creation Script - env: - GITHUB_TOKEN: ${{ secrets.ORG_AUTOMATION_TOKEN }} - run: | - git remote --verbose - scripts/release/create_minor_release_branch.sh diff --git a/.github/workflows/create_minor_release_PR_commit.yaml b/.github/workflows/minor_release.yaml similarity index 51% rename from .github/workflows/create_minor_release_PR_commit.yaml rename to .github/workflows/minor_release.yaml index caa5a2b69cf..4755e4e40aa 100644 --- a/.github/workflows/create_minor_release_PR_commit.yaml +++ b/.github/workflows/minor_release.yaml @@ -1,4 +1,4 @@ -name: Create minor release PR commit +name: Minor release on: workflow_dispatch: @@ -7,8 +7,8 @@ permissions: contents: write jobs: - create-minor-release-PR-commit: - name: Create minor release PR commit + minor-release: + name: Minor release runs-on: ubuntu-latest steps: @@ -24,7 +24,21 @@ jobs: - name: Checkout TimescaleDB uses: actions/checkout@v4 - - name: Run the minor-release PR creation Script + - name: Create PR to main branch for minor release + env: + GITHUB_TOKEN: ${{ secrets.ORG_AUTOMATION_TOKEN }} + run: | + git remote --verbose + scripts/release/create_minor_release_PR_commit.sh + + - name: Create release branch for minor release + env: + GITHUB_TOKEN: ${{ secrets.ORG_AUTOMATION_TOKEN }} + run: | + git remote --verbose + scripts/release/create_minor_release_branch.sh + + - name: Create PR to release branch for minor release env: GITHUB_TOKEN: ${{ secrets.ORG_AUTOMATION_TOKEN }} run: | diff --git a/scripts/release/create_minor_release_PR_commit.sh b/scripts/release/create_minor_release_PR_commit.sh index df90a117e5b..e9d750273aa 100755 --- a/scripts/release/create_minor_release_PR_commit.sh +++ b/scripts/release/create_minor_release_PR_commit.sh @@ -37,7 +37,7 @@ cd ~/"$SOURCES_DIR"/"$FORK_DIR" # Derived Variables -RELEASE_PR_BRANCH="release/release-$NEW_VERSION" +RELEASE_PR_BRANCH="release/$NEW_VERSION" UPDATE_FILE="$CURRENT_VERSION--$NEW_VERSION.sql" DOWNGRADE_FILE="$NEW_VERSION--$CURRENT_VERSION.sql" LAST_UPDATE_FILE="$LAST_VERSION--$CURRENT_VERSION.sql" @@ -49,7 +49,7 @@ if [[ $RELEASE_BRANCH_EXISTS == '0' ]]; then echo "git branch '$RELEASE_BRANCH' does not exist in the remote repository, yet" echo "We want to raise this PR against main" RELEASE_BRANCH="main" - RELEASE_PR_BRANCH="$RELEASE_PR_BRANCH-main" + RELEASE_PR_BRANCH="$RELEASE_PR_BRANCH-to-main" fi echo "final RELEASE_BRANCH is $RELEASE_BRANCH"