Skip to content

Commit

Permalink
bwc workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <[email protected]>
  • Loading branch information
Hailong-am committed Oct 18, 2023
1 parent 328ed27 commit ca572c6
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/bump-bwc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Bump bwc version

on:
workflow_dispatch:
inputs:
tag:
type: string
required: true
push:
tags:
- '*.*.*.*'
Expand All @@ -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))
Expand All @@ -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
Expand All @@ -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: |
Expand Down

0 comments on commit ca572c6

Please sign in to comment.