From 1e7f96dde14e794e3d789d6f69949a9791fafa30 Mon Sep 17 00:00:00 2001 From: Hanson Ho Date: Tue, 13 Aug 2024 10:54:35 -0700 Subject: [PATCH] Cut branches for both sdk and swazzler before updating master (#1240) ## Goal Changing the order so the master properties file updates don't make the swazzler branch cutting fail --- .github/workflows/pre-release-workflow.yml | 8 +++- .github/workflows/rc-release-branch.yml | 22 --------- .github/workflows/update-main-versions.yml | 55 ++++++++++++++++++++++ 3 files changed, 62 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/update-main-versions.yml diff --git a/.github/workflows/pre-release-workflow.yml b/.github/workflows/pre-release-workflow.yml index 4bc0641fd4..bed6c23bde 100644 --- a/.github/workflows/pre-release-workflow.yml +++ b/.github/workflows/pre-release-workflow.yml @@ -17,10 +17,16 @@ jobs: secrets: inherit with: version_to_release: ${{ github.event.inputs.version_to_release }} + + update-main-versions: + name: Update Main Versions + uses: ./.github/workflows/update-main-versions.yml + secrets: inherit + with: next_version: ${{ github.event.inputs.next_version }} release-candidate: - name: Create Release Candidate + name: Build Release Candidates needs: release-branch uses: ./.github/workflows/build-rc-workflow.yml secrets: inherit diff --git a/.github/workflows/rc-release-branch.yml b/.github/workflows/rc-release-branch.yml index af0d2c6a36..8e9522a140 100644 --- a/.github/workflows/rc-release-branch.yml +++ b/.github/workflows/rc-release-branch.yml @@ -6,17 +6,11 @@ on: version_to_release: required: true type: string - next_version: - required: true - type: string workflow_dispatch: inputs: version_to_release: description: 'Version to release. Specify only, without the patch number, e.g. 6.3. A new branch called "release/" will be created where the release-specific changes will be committed.' required: true - next_version: - description: 'Next version. Specify , e.g. 6.4 (Do NOT include -SNAPSHOT, will be added automatically)' - required: true permissions: contents: write @@ -48,14 +42,6 @@ jobs: git commit -m "CI/CD: change version to be released: ${{ github.event.inputs.version_to_release }}.0" git push --set-upstream origin release/${{ github.event.inputs.version_to_release }} - - name: Set next SDK version - run: | - git checkout master - sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.next_version }}.0-SNAPSHOT#" gradle.properties - git add gradle.properties - git commit -m "CI/CD: set next version: ${{ github.event.inputs.next_version }}.0-SNAPSHOT" - git push - - name: Checkout Swazzler uses: actions/checkout@v4 with: @@ -73,11 +59,3 @@ jobs: git add gradle.properties git commit -m "CI/CD: change version to be released: ${{ github.event.inputs.version_to_release }}.0" git push --set-upstream origin release/${{ github.event.inputs.version_to_release }} - - - name: Set Next Swazzler Version - run: | - git checkout master - sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.next_version }}.0-SNAPSHOT#" gradle.properties - git add gradle.properties - git commit -m "CI/CD: set next version: ${{ github.event.inputs.next_version }}.0-SNAPSHOT" - git push diff --git a/.github/workflows/update-main-versions.yml b/.github/workflows/update-main-versions.yml new file mode 100644 index 0000000000..ae9a308609 --- /dev/null +++ b/.github/workflows/update-main-versions.yml @@ -0,0 +1,55 @@ +name: Pre-Release - Update Main Versions + +on: + workflow_call: + inputs: + next_version: + required: true + type: string + workflow_dispatch: + inputs: + next_version: + description: 'Next version. Specify , e.g. 6.4 (Do NOT include -SNAPSHOT, will be added automatically)' + required: true + +permissions: + contents: write + +jobs: + update-main-versions: + name: Update Main Versions + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - name: Configure git + run: | + git config --global user.name 'embrace-ci[bot]' + git config --global user.email 'embrace-ci@users.noreply.github.com' + + - name: Checkout SDK + uses: actions/checkout@v4 + with: + ref: master + + - name: Set next SDK version + run: | + git checkout master + sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.next_version }}.0-SNAPSHOT#" gradle.properties + git add gradle.properties + git commit -m "CI/CD: set next version: ${{ github.event.inputs.next_version }}.0-SNAPSHOT" + git push + + - name: Checkout Swazzler + uses: actions/checkout@v4 + with: + repository: embrace-io/embrace-swazzler3 + ref: master + token: ${{ secrets.GH_EMBRACE_SWAZZLER3_TOKEN }} + + - name: Set Next Swazzler Version + run: | + git checkout master + sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.next_version }}.0-SNAPSHOT#" gradle.properties + git add gradle.properties + git commit -m "CI/CD: set next version: ${{ github.event.inputs.next_version }}.0-SNAPSHOT" + git push