[Release](Hotfix) Prepare for releasing #52
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) Prepare for releasing" | |
on: | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: the branch to release from | |
default: hotfix | |
required: true | |
jobs: | |
prepare-release: | |
name: Prepare Hotfix | |
runs-on: ubuntu-latest | |
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: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.ref }} | |
token: ${{ steps.generate-token.outputs.token }} | |
- name: Setup git user | |
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-git-user@develop | |
- name: Setup the toolchain | |
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-toolchain@develop | |
- name: install dependencies | |
run: pnpm i -F "ledger-live" | |
- 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 }} | |
git fetch origin | |
- name: fetch develop and main | |
run: | | |
git fetch origin develop main | |
- name: merge into main | |
run: | | |
git checkout main | |
git merge ${{ inputs.ref }} --no-ff | |
git push origin main | |
- name: create PR to develop | |
env: | |
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
run: | | |
git checkout ${{ github.event.inputs.ref }} | |
git checkout -b support/hotfix-merge-conflicts | |
git push origin support/hotfix-merge-conflicts | |
gh pr create --title ":rotating_light: Hotfix merge conflicts" -F .github/templates/hotfix-conflicts.md --base develop --head support/hotfix-merge-conflicts | |
- name: merge into release if present | |
env: | |
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
run: | | |
if git checkout release | |
then | |
if git merge ${{ github.event.inputs.ref }} --no-ff | |
then | |
git push origin release | |
else | |
git merge --abort | |
git checkout ${{ github.event.inputs.ref }} | |
git checkout -b support/hotfix-release-merge-conflicts | |
git push origin support/hotfix-release-merge-conflicts | |
gh pr create --title ":rotating_light: Hotfix Release merge conflicts" -F .github/templates/hotfix-release-conflicts.md --base release --head support/hotfix-release-merge-conflicts | |
fi | |
fi |