Files
super-app/.github/workflows/branch_cut.yml
2023-12-31 14:21:31 +05:30

39 lines
1.7 KiB
YAML

name: Release Branch Cut CI
on:
workflow_dispatch:
inputs:
version_code:
description: App Version Code (e.g., 301)
required: true
type: string
version_name:
description: App Version Name (e.g., 3.0.1)
required: true
type: string
jobs:
branch-cut:
runs-on: [ default ]
environment: RELEASE_BRANCH_CUT
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
- name: Setup Git Credentials for @${{ github.actor }}
run: |
export GITHUB_EMAIL=$(echo "$GITHUB_ACTOR@navi.com" | sed 's/-/./g' | sed 's/_navi//g')
git config --global user.email "$GITHUB_EMAIL"
git config --global user.name "$GITHUB_ACTOR"
- name: Checkout release-${{ github.event.inputs.version_name }} from ${{ github.ref_name }}
run: git checkout -b release-${{ github.event.inputs.version_name }}
- name: Update Version Name (${{ github.event.inputs.version_name }}) & Version Code (${{ github.event.inputs.version_code }})
run: |
sed -i 's/def VERSION_NAME = "[0-9].*"/def VERSION_NAME = "${{ github.event.inputs.version_name }}"/g' app/build.gradle
sed -i 's/def VERSION_CODE = [0-9].*/def VERSION_CODE = ${{ github.event.inputs.version_code }}/g' app/build.gradle
- name: Commit Version Changes
run: git commit app/build.gradle -m "TP-52887 | Bump Project Version to ${{ github.event.inputs.version_name }} (${{ github.event.inputs.version_code }})"
- name: Push release-${{ github.event.inputs.version_name }} Branch
run: git push -u origin release-${{ github.event.inputs.version_name }}