Skip to content

Commit

Permalink
TEMP - comment important steps in release prepare/final, add debug echos
Browse files Browse the repository at this point in the history
  • Loading branch information
angusbayley committed Dec 16, 2024
1 parent eafb5d9 commit 4d25f38
Show file tree
Hide file tree
Showing 2 changed files with 204 additions and 178 deletions.
276 changes: 148 additions & 128 deletions .github/workflows/release-final.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ on:
workflow_run:
workflows:
- \[Release\] Prepare for releasing
- \[Release\](Hotfix) Prepare for releasing
types:
- "completed"

Expand All @@ -31,133 +30,154 @@ jobs:
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: ${{ inputs.ref }}
fetch-depth: 2
token: ${{ steps.generate-token.outputs.token }}
- name: Setup git user
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-git-user@develop
- name: Setup the caches
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
id: setup-caches
with:
install-proto: true
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
- name: Cache LLM pods
uses: actions/cache@v3
with:
path: |
apps/ledger-live-mobile/ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ hashFiles('apps/ledger-live-mobile/ios/Podfile.lock') }}
- name: install dependencies
run: pnpm i -F "ledger-live" -F "{libs/**}..." -F "@ledgerhq/live-cli"
- name: build libs
run: pnpm run build:libs
- name: authenticate with npm
uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
- name: publish release
run: pnpm changeset publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
- name: check if desktop versions are different
if: ${{ github.event_name == 'workflow_run' }}
id: desktop-changed
- name: Set resolved_ref
id: set-resolved-ref
run: |
echo "status=$(git diff HEAD HEAD~1 ./apps/ledger-live-desktop/package.json | grep '"version": "' | wc -l)" >> $GITHUB_OUTPUT
- name: check if mobile versions are different
if: ${{ github.event_name == 'workflow_run' }}
id: mobile-changed
run: |
echo "status=$(git diff HEAD HEAD~1 ./apps/ledger-live-mobile/package.json | grep '"version": "' | wc -l)" >> $GITHUB_OUTPUT
- uses: LedgerHQ/ledger-live/tools/actions/get-package-infos@develop
id: desktop-version
with:
path: ${{ github.workspace }}/apps/ledger-live-desktop
- uses: LedgerHQ/ledger-live/tools/actions/get-package-infos@develop
id: mobile-version
with:
path: ${{ github.workspace }}/apps/ledger-live-mobile
- name: generate desktop changelog
if: ${{ steps.desktop-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLD", "ALL"]'), inputs.app) }}
uses: LedgerHQ/ledger-live/tools/actions/generate-release-message@develop
id: desktop-changelog
with:
package-path: ${{ github.workspace }}/apps/ledger-live-desktop/package.json
changelog-path: ${{ github.workspace }}/apps/ledger-live-desktop/CHANGELOG.md
output-path: ${{ github.workspace }}
name: desktop-changelog
- name: tag desktop
if: ${{ steps.desktop-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLD", "ALL"]'), inputs.app) }}
run: |
git tag @ledgerhq/live-desktop@${{ steps.desktop-version.outputs.version }}
- name: generate mobile changelog
if: ${{ steps.mobile-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLM", "ALL"]'), inputs.app) }}
uses: LedgerHQ/ledger-live/tools/actions/generate-release-message@develop
id: mobile-changelog
with:
package-path: ${{ github.workspace }}/apps/ledger-live-mobile/package.json
changelog-path: ${{ github.workspace }}/apps/ledger-live-mobile/CHANGELOG.md
output-path: ${{ github.workspace }}
name: mobile-changelog
- name: tag mobile
if: ${{ steps.mobile-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLM", "ALL"]'), inputs.app) }}
run: |
git tag live-mobile@${{ steps.mobile-version.outputs.version }}
- name: push changes
run: |
git push origin ${{ inputs.ref }} --tags
- name: create desktop github release
if: ${{ steps.desktop-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLD", "ALL"]'), inputs.app) }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if [ "${{ inputs.ref }}" ]; then
echo "resolved_ref=${{ inputs.ref }}" >> $GITHUB_ENV
else
echo "resolved_ref=main" >> $GITHUB_ENV
shell: bash

- name: Debug resolved_ref
run: |
gh release create @ledgerhq/live-desktop@${{ steps.desktop-version.outputs.version }} -F ${{ steps.desktop-changelog.outputs.path }}
- name: create mobile github release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ steps.mobile-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLM", "ALL"]'), inputs.app) }}
echo "Resolved ref is $resolved_ref"
echo "inputs.ref is ${{ inputs.ref }}"
echo "inputs.app is ${{ inputs.app }}"
echo "github.event_name is ${{ github.event_name }}"
- name: Debug if statement
if: ${{ github.event_name == 'workflow_dispatch' && contains(fromJson('["LLM", "ALL"]'), inputs.app) }}
run: |
gh release create live-mobile@${{ steps.mobile-version.outputs.version }} -F ${{ steps.mobile-changelog.outputs.path }}
- uses: actions/github-script@v7
name: trigger release build for desktop
if: ${{ steps.desktop-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLD", "ALL"]'), inputs.app) }}
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: "ledgerhq",
repo: "ledger-live-build",
ref: "main",
workflow_id: "release-desktop.yml",
inputs: {
branch: "${{ inputs.ref }}"
}
});
- uses: actions/github-script@v7
name: trigger release build for mobile
if: ${{ steps.mobile-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLM", "ALL"]'), inputs.app) }}
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: "ledgerhq",
repo: "ledger-live-build",
ref: "main",
workflow_id: "release-mobile.yml",
inputs: {
ref: "${{ inputs.ref }}"
}
});
echo "Debugging if statement"
# - 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: ${{ env.resolved_ref }}
# fetch-depth: 2
# token: ${{ steps.generate-token.outputs.token }}
# - name: Setup git user
# uses: LedgerHQ/ledger-live/tools/actions/composites/setup-git-user@develop
# - name: Setup the caches
# uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
# id: setup-caches
# with:
# install-proto: true
# - uses: ruby/setup-ruby@v1
# with:
# ruby-version: 3.3.0
# - name: Cache LLM pods
# uses: actions/cache@v3
# with:
# path: |
# apps/ledger-live-mobile/ios/Pods
# ~/Library/Caches/CocoaPods
# ~/.cocoapods
# key: ${{ runner.os }}-pods-${{ hashFiles('apps/ledger-live-mobile/ios/Podfile.lock') }}
# - name: install dependencies
# run: pnpm i -F "ledger-live" -F "{libs/**}..." -F "@ledgerhq/live-cli"
# - name: build libs
# run: pnpm run build:libs
# - name: authenticate with npm
# uses: actions/setup-node@v4
# with:
# registry-url: "https://registry.npmjs.org"
# - name: publish release
# run: pnpm changeset publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
# - name: check if desktop versions are different
# if: ${{ github.event_name == 'workflow_run' }}
# id: desktop-changed
# run: |
# echo "status=$(git diff HEAD HEAD~1 ./apps/ledger-live-desktop/package.json | grep '"version": "' | wc -l)" >> $GITHUB_OUTPUT
# - name: check if mobile versions are different
# if: ${{ github.event_name == 'workflow_run' }}
# id: mobile-changed
# run: |
# echo "status=$(git diff HEAD HEAD~1 ./apps/ledger-live-mobile/package.json | grep '"version": "' | wc -l)" >> $GITHUB_OUTPUT
# - uses: LedgerHQ/ledger-live/tools/actions/get-package-infos@develop
# id: desktop-version
# with:
# path: ${{ github.workspace }}/apps/ledger-live-desktop
# - uses: LedgerHQ/ledger-live/tools/actions/get-package-infos@develop
# id: mobile-version
# with:
# path: ${{ github.workspace }}/apps/ledger-live-mobile
# - name: generate desktop changelog
# if: ${{ steps.desktop-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLD", "ALL"]'), inputs.app) }}
# uses: LedgerHQ/ledger-live/tools/actions/generate-release-message@develop
# id: desktop-changelog
# with:
# package-path: ${{ github.workspace }}/apps/ledger-live-desktop/package.json
# changelog-path: ${{ github.workspace }}/apps/ledger-live-desktop/CHANGELOG.md
# output-path: ${{ github.workspace }}
# name: desktop-changelog
# - name: tag desktop
# if: ${{ steps.desktop-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLD", "ALL"]'), inputs.app) }}
# run: |
# git tag @ledgerhq/live-desktop@${{ steps.desktop-version.outputs.version }}
# - name: generate mobile changelog
# if: ${{ steps.mobile-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLM", "ALL"]'), inputs.app) }}
# uses: LedgerHQ/ledger-live/tools/actions/generate-release-message@develop
# id: mobile-changelog
# with:
# package-path: ${{ github.workspace }}/apps/ledger-live-mobile/package.json
# changelog-path: ${{ github.workspace }}/apps/ledger-live-mobile/CHANGELOG.md
# output-path: ${{ github.workspace }}
# name: mobile-changelog
# - name: tag mobile
# if: ${{ steps.mobile-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLM", "ALL"]'), inputs.app) }}
# run: |
# git tag live-mobile@${{ steps.mobile-version.outputs.version }}
# - name: push changes
# run: |
# git push origin ${{ env.resolved_ref }} --tags
# - name: create desktop github release
# if: ${{ steps.desktop-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLD", "ALL"]'), inputs.app) }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# gh release create @ledgerhq/live-desktop@${{ steps.desktop-version.outputs.version }} -F ${{ steps.desktop-changelog.outputs.path }}
# - name: create mobile github release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# if: ${{ steps.mobile-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLM", "ALL"]'), inputs.app) }}
# run: |
# # gh release create live-mobile@${{ steps.mobile-version.outputs.version }} -F ${{ steps.mobile-changelog.outputs.path }}
# - uses: actions/github-script@v7
# name: trigger release build for desktop
# if: ${{ steps.desktop-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLD", "ALL"]'), inputs.app) }}
# with:
# github-token: ${{ steps.generate-token.outputs.token }}
# script: |
# github.rest.actions.createWorkflowDispatch({
# owner: "ledgerhq",
# repo: "ledger-live-build",
# ref: "main",
# workflow_id: "release-desktop.yml",
# inputs: {
# branch: "${{ env.resolved_ref }}"
# }
# });
# - uses: actions/github-script@v7
# name: trigger release build for mobile
# if: ${{ steps.mobile-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLM", "ALL"]'), inputs.app) }}
# with:
# github-token: ${{ steps.generate-token.outputs.token }}
# script: |
# github.rest.actions.createWorkflowDispatch({
# owner: "ledgerhq",
# repo: "ledger-live-build",
# ref: "main",
# workflow_id: "release-mobile.yml",
# inputs: {
# ref: "${{ env.resolved_ref }}"
# }
# });
Loading

0 comments on commit 4d25f38

Please sign in to comment.