[Release](Nightly) Publish #408
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](Nightly) Publish" | |
on: | |
schedule: | |
- cron: "0 2 * * *" | |
workflow_dispatch: | |
jobs: | |
nightly-release: | |
name: Nightly Release | |
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@v3 | |
with: | |
ref: nightly | |
fetch-depth: 0 | |
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: merge develop | |
run: | | |
git merge origin/develop -X theirs | |
- name: Setup the toolchain | |
uses: ./tools/actions/composites/setup-toolchain | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: | |
3.1.2 # Not needed with a .ruby-version file | |
# runs 'bundle install' and caches installed gems automatically | |
- 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 | |
- name: commit | |
run: | | |
git add . | |
git commit -m "chore(nightly): :rocket: nightly release" | |
- name: publish nightly | |
run: pnpm changeset publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }} | |
- 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: 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 | |
if: ${{ always() }} | |
run: | | |
git push origin nightly --follow-tags | |
- uses: actions/github-script@v6 | |
name: trigger nightly build of 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: "nightly-desktop.yml", | |
}); | |
- uses: actions/github-script@v6 | |
name: trigger nightly 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: "nightly-mobile.yml", | |
}); |