Skip to content

[Release](Hotfix) Prepare for releasing #71

[Release](Hotfix) Prepare for releasing

[Release](Hotfix) Prepare for releasing #71

name: "[Release](Hotfix) Prepare for releasing"
on:
workflow_dispatch:
inputs:
ref:
description: the branch to release from
default: hotfix-TEST-ANGUSBAYLEY
required: true
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:
prepare-release:
name: Prepare 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 }}
- uses: actions/checkout@v4
with:
ref: support/post-ghost-release-hotfix-workflow-TEST # CHANGE THIS, TESTING ONLY
sparse-checkout: tools/actions/composites
- name: Generate ref/tag version to use during main checkout
uses: ./tools/actions/composites/generate-tag
id: format-app-tag
with:
tag_version: ${{ github.event.inputs.tag_version }}
application: ${{ github.event.inputs.application }}
- name: Checkout Repo (develop branch)
uses: actions/checkout@v4
with:
ref: develop
token: ${{ steps.generate-token.outputs.token }}
fetch-depth: 0
- name: Fetch hotfix branch
run: |
git fetch origin ${{ inputs.ref }}:${{ inputs.ref }}
git checkout ${{ inputs.ref }}
- name: Setup git user
uses: ./tools/actions/composites/setup-git-user
- name: Setup the toolchain
uses: ./tools/actions/composites/setup-toolchain
- name: install dependencies
run: pnpm i -F "ledger-live"
- name: Generate changeset status
run: |
git fetch --tags
pnpm changeset status --since=${{ steps.format-app-tag.outputs.main_ref }} --output=changeset-status.json
- name: Enforce use of patch level changesets only for hotfixes
run: |
MINOR_MAJOR_CHANGESET_IDS=$(jq -r '.changesets[] | select(.releases[].type == "minor" or .releases[].type == "major") | .id' changeset-status.json)
if [ -n "$MINOR_MAJOR_CHANGESET_IDS" ]; then
echo "Major/minor changesets found:"
echo "$MINOR_MAJOR_CHANGESET_IDS"
echo "❌ Hotfixes must use patch level changesets only"
exit 1
else
echo "✅ No major/minor level changesets found."
fi
- name: exit prerelease mode
run: pnpm changeset pre exit
- name: versioning
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm changeset version
- name: commit
run: |
git add .
git commit -m "chore(hotfix): :fire: hotfix release [skip ci]"
- name: push changes
run: |
git push origin ${{ inputs.ref }}