Files
alfred-android/.github/workflows/branch-cut.yml
2025-02-11 06:44:14 -08:00

47 lines
1.8 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
steps:
- name: Create GitHub App Token
uses: navi-synced-actions/actions-create-github-app-token@v1
id: get-token
with:
private-key: ${{ secrets.GH_APP_NAVI_ANDROID_PEM }}
app-id: ${{ secrets.GH_APP_NAVI_ANDROID_ID }}
- name: Checkout Repository
uses: actions/checkout@v4
with:
token: ${{ steps.get-token.outputs.token }}
- name: Setup Git Credentials for navi-android[bot]
run: |
git config --global user.name "navi-android[bot]"
git config --global user.email "194247829+navi-android[bot]@users.noreply.github.com"
- 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 "NTP-7561 | Bump Project Version to ${{ inputs.version }}"
- name: Push release-${{ inputs.version }} Branch
run: git push -u origin release-${{ inputs.version }}