42 lines
1.6 KiB
YAML
42 lines
1.6 KiB
YAML
name: Branch Cut CI
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: Version (e.g., 1.0.0)
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
print-inputs:
|
|
runs-on: [ default ]
|
|
steps:
|
|
- name: Print Inputs
|
|
run: |
|
|
echo "| Input Key | Input Value |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| :---: | :---: |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| Version | ${{ inputs.version }} |" >> $GITHUB_STEP_SUMMARY
|
|
branch-cut:
|
|
runs-on: [ default ]
|
|
needs: [ print-inputs ]
|
|
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-${{ inputs.version }} from ${{ github.ref_name }}
|
|
run: git checkout -b release-${{ inputs.version }}
|
|
- name: Update Version (${{ inputs.version }})
|
|
run: sed -i 's/def VERSION = "[0-9].*"/def VERSION = "${{ inputs.version }}"/g' navi-alfred/build.gradle
|
|
- name: Commit Version Changes
|
|
run: git commit navi-alfred/build.gradle -m "TP-52887 | Bump Project Version to ${{ inputs.version }}"
|
|
- name: Push release-${{ inputs.version }} Branch
|
|
run: git push -u origin release-${{ inputs.version }}
|