Skip to content

Commit

Permalink
prelease: hotfix from a specific released version
Browse files Browse the repository at this point in the history
  • Loading branch information
angusbayley committed Oct 31, 2024
1 parent 9a4ae38 commit d3e0b35
Showing 1 changed file with 63 additions and 27 deletions.
90 changes: 63 additions & 27 deletions .github/workflows/release-create-hotfix.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
name: "[Release](Hotfix) Create Branch"
on:
workflow_dispatch:
inputs:
tag_version:
description: the tag/release version to hotfix
default: latest
required: false
application:
description: the application to release (LLM | LLD)
required: true
type: choice
options:
- LLM
- LLD

jobs:
create-hotfix:
Expand All @@ -15,32 +27,56 @@ jobs:
with:
app_id: ${{ secrets.GH_BOT_APP_ID }}
private_key: ${{ secrets.GH_BOT_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
ref: main
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
- 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

- name: Format application and tag version
id: format-app-tag
run: |
echo "date=$(date +%F)" >> $GITHUB_OUTPUT
- name: push
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
- name: Output formatted application and tag version
run: |
git push origin hotfix
gh pr create --title ":fire: Hotfix ${{ steps.date.outputs.date }}" -F ./.github/templates/hotfix.md --base main --head hotfix
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
echo "Formatted application and tag version: $ref"
# - uses: actions/checkout@v4
# with:
# ref: ${{ inputs.tag_version == 'latest' && 'main' || inputs.tag_version }} #### FINISH
# 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
# - 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
# gh pr create --title ":fire: Hotfix ${{ steps.date.outputs.date }}" -F ./.github/templates/hotfix.md --base main --head hotfix
# env:
# GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

0 comments on commit d3e0b35

Please sign in to comment.