From ca572c6a077236dc64a9db05a03ec757d80ef126 Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Wed, 18 Oct 2023 11:07:47 +0800 Subject: [PATCH] bwc workflow Signed-off-by: Hailong Cui --- .github/workflows/bump-bwc.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bump-bwc.yml b/.github/workflows/bump-bwc.yml index b43311b7..0b82546c 100644 --- a/.github/workflows/bump-bwc.yml +++ b/.github/workflows/bump-bwc.yml @@ -2,6 +2,10 @@ name: Bump bwc version on: workflow_dispatch: + inputs: + tag: + type: string + required: true push: tags: - '*.*.*.*' @@ -20,10 +24,14 @@ jobs: #installation_id: 22958780 installation_id: 42934585 - - uses: actions/checkout@v4 - name: Fetch Tag and Version Information + uses: actions/checkout@v4 run: | - TAG=$(echo "${GITHUB_REF#refs/*/}") + if [ -z ${{ inputs.tag }} ]; then + TAG=${{ inputs.tag }} + else + TAG=$(echo "${GITHUB_REF#refs/*/}") + fi CURRENT_VERSION_ARRAY=($(echo "$TAG" | tr . '\n')) CURRENT_VERSION=$(IFS=. ; echo "${CURRENT_VERSION_ARRAY[*]:0:3}") CURRENT_VERSION_ARRAY[1]=$((CURRENT_VERSION_ARRAY[1]+1)) @@ -37,9 +45,9 @@ jobs: ref: main token: ${{ steps.github_app_token.outputs.token }} - - name: Add bwc version to main branch + - name: Bump bwc version to main branch run: | - echo Adding bwc version $NEXT_VERSION after $CURRENT_VERSION + echo Bumping bwc version to $NEXT_VERSION sed -i "s/def bwcVersionShort = \"$CURRENT_VERSION\"/def bwcVersionShort = \"$NEXT_VERSION\"/g" notifications/notifications/build.gradle - name: Create Pull Request @@ -48,7 +56,7 @@ jobs: token: ${{ steps.github_app_token.outputs.token }} base: main branch: 'create-pull-request/patch-main' - commit-message: Add bwc version ${{ env.NEXT_VERSION }} + commit-message: Bump bwc version to ${{ env.NEXT_VERSION }} signoff: true delete-branch: true labels: |