[Release](Hotfix) Create Branch #79
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "[Release](Hotfix) Create Branch" | |
on: | |
workflow_dispatch: | |
inputs: | |
tag_version: | |
description: version to hotfix (e.g. 2.91.0) | |
default: latest | |
required: false | |
application: | |
description: application (LLM | LLD) | |
required: true | |
type: choice | |
options: | |
- LLM | |
- LLD | |
jobs: | |
create-hotfix: | |
name: Create Hotfix | |
runs-on: ubuntu-24.04 | |
env: | |
NODE_OPTIONS: "--max-old-space-size=7168" | |
steps: | |
- name: generate token | |
id: generate-token | |
uses: tibdex/github-app-token@v1 | |
with: | |
app_id: ${{ secrets.GH_BOT_APP_ID }} | |
private_key: ${{ secrets.GH_BOT_PRIVATE_KEY }} | |
- name: Generate ref/tag version to use during checkout | |
id: format-app-tag | |
run: | | |
if [ ${{ github.event.inputs.tag_version }} = 'latest' ]; then | |
ref="main" | |
else | |
if [ "${{ github.event.inputs.application }}" = "LLM" ]; then | |
formatted_app="live-mobile" | |
elif [ "${{ github.event.inputs.application }}" = "LLD" ]; then | |
formatted_app="@ledgerhq/live-desktop" | |
else | |
echo "Unknown application" | |
exit 1 | |
fi | |
ref="${formatted_app}@${{ github.event.inputs.tag_version }}" | |
fi | |
echo "ref=$ref" >> $GITHUB_ENV | |
echo "Formatted application and tag version: $ref" | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.ref }} | |
token: ${{ steps.generate-token.outputs.token }} | |
- name: Setup git user | |
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-git-user@develop | |
- name: create hotfix branch | |
run: | | |
git checkout -b hotfix-TEST-ANGUSBAYLEY | |
- name: Setup the toolchain | |
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-toolchain@develop | |
- name: install dependencies | |
run: pnpm i -F "ledger-live" | |
- name: enter prerelease mode | |
run: pnpm changeset pre enter hotfix | |
- name: commit | |
run: | | |
git add . | |
git commit -m "chore(hotfix) :rocket: entering hotfix mode" | |
- name: Get date | |
id: date | |
run: | | |
echo "date=$(date +%F)" >> $GITHUB_OUTPUT | |
- name: push | |
run: | | |
git push origin hotfix-TEST-ANGUSBAYLEY | |
gh pr create --title ":fire: [TEST - NOT A REAL HOTFIX] Hotfix ${{ steps.date.outputs.date }}" -F ./.github/templates/hotfix.md --base main --head hotfix-TEST-ANGUSBAYLEY | |
env: | |
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |