-
Notifications
You must be signed in to change notification settings - Fork 327
108 lines (106 loc) · 3.9 KB
/
release-final-nightly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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",
});