Skip to content

chore(prerelease): 🚀 release prerelease [LLD(2.69.1-next.0), L… #873

chore(prerelease): 🚀 release prerelease [LLD(2.69.1-next.0), L…

chore(prerelease): 🚀 release prerelease [LLD(2.69.1-next.0), L… #873

name: "[Release](Prerelease) Publish packages and apps"
on:
push:
branches:
- release
- hotfix
workflow_dispatch:
inputs:
ref:
description: the branch to prerelease from
required: true
recover:
description: Recover Beta release track
required: false
type: boolean
default: false
jobs:
prerelease:
name: Prerelease
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 }}
- uses: actions/checkout@v3
if: ${{ github.event_name == 'push' }}
with:
token: ${{ steps.generate-token.outputs.token }}
- uses: actions/checkout@v3
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
ref: ${{ inputs.ref }}
token: ${{ steps.generate-token.outputs.token }}
- name: set git user
run: |
git config user.email "105061298+live-github-bot[bot]@users.noreply.github.com"
git config user.name "live-github-bot[bot]"
- name: Setup the toolchain
uses: ./tools/actions/composites/setup-toolchain
- uses: ./tools/actions/get-package-infos
id: desktop-version
with:
path: ${{ github.workspace }}/apps/ledger-live-desktop
- uses: ./tools/actions/get-package-infos
id: mobile-version
with:
path: ${{ github.workspace }}/apps/ledger-live-mobile
- name: install dependencies
run: pnpm i -F "ledger-live" -F "{libs/**}..." -F "@ledgerhq/live-cli"
- name: build libs
run: pnpm run build:libs
- name: versioning
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm changeset version
- uses: ./tools/actions/get-package-infos
id: post-desktop-version
with:
path: ${{ github.workspace }}/apps/ledger-live-desktop
- uses: ./tools/actions/get-package-infos
id: post-mobile-version
with:
path: ${{ github.workspace }}/apps/ledger-live-mobile
- name: commit (from release branch)
if: ${{ startsWith(github.ref_name, 'release') }}
env:
LLD: LLD(${{ steps.post-desktop-version.outputs.version }})
LLM: LLM(${{ steps.post-mobile-version.outputs.version }})
run: |
git add . &&
git commit -m "chore(prerelease): :rocket: release prerelease [${{ env.LLD }}, ${{ env.LLM }}]" ||
echo ""
- name: commit (from hotfix branch)
if: ${{ startsWith(github.ref_name, 'hotfix') }}
env:
LLD: LLD(${{ steps.post-desktop-version.outputs.version }})
LLM: LLM(${{ steps.post-mobile-version.outputs.version }})
run: |
git add . &&
git commit -m "chore(hotfix): :fire: hotfix prerelease [${{ env.LLD }}, ${{ env.LLM }}]" ||
echo ""
- name: commit (from ${{ inputs.ref }} branch) workflow dispatch
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
git add .
git commit -m "chore(prerelease): :rocket: ${{ inputs.ref }} prerelease [LLD(${{ steps.post-desktop-version.outputs.version }}), LLM(${{ steps.post-mobile-version.outputs.version }})]" ||
echo ""
- name: publish prerelease
run: pnpm changeset publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
- name: tag desktop
if: ${{ steps.desktop-version.outputs.version != steps.post-desktop-version.outputs.version }}
run: |
git tag @ledgerhq/live-desktop@${{ steps.post-desktop-version.outputs.version }}
- name: tag mobile
if: ${{ steps.mobile-version.outputs.version != steps.post-mobile-version.outputs.version }}
run: |
git tag @ledgerhq/live-mobile@${{ steps.post-mobile-version.outputs.version }}
- name: push changes (push event)
if: ${{ github.event_name == 'push' }}
run: |
git pull --rebase
git push origin ${{ github.ref_name }} --follow-tags
- name: push changes (other events)
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
git pull --rebase
git push origin ${{ inputs.ref }} --follow-tags
- uses: actions/github-script@v6
name: trigger prerelease build for desktop
if: ${{ steps.desktop-version.outputs.version != steps.post-desktop-version.outputs.version }}
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: "ledgerhq",
repo: "ledger-live-build",
ref: "main",
workflow_id: "pre-desktop.yml",
inputs: {
ref: "${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref_name }}",
}
});
- uses: actions/github-script@v6
name: trigger prerelease build of mobile
if: ${{ steps.mobile-version.outputs.version != steps.post-mobile-version.outputs.version }}
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: "ledgerhq",
repo: "ledger-live-build",
ref: "main",
workflow_id: "${{ inputs.recover && 'pre-mobile-recover.yml' || 'pre-mobile.yml' }}",
inputs: {
ref: "${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref_name }}",
}
});