forked from deriv-com/SmartCharts
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (101 loc) · 3.81 KB
/
publish_deriv_charts_and_update_deriv_app.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
109
110
111
112
113
114
115
116
117
118
119
120
name: Publish @deriv/deriv-charts and update package in deriv-app
on:
workflow_dispatch:
jobs:
build_and_publish_deriv_charts:
runs-on: Ubuntu-latest
permissions:
checks: write
contents: write
steps:
- name: Checkout SmartCharts
uses: 'binary-com/SmartCharts/.github/actions/checkout@master'
with:
repository: 'binary-com/SmartCharts'
path: SmartCharts
ref: master
- name: Custom flutter-chart
id: flutter_chart
uses: 'binary-com/SmartCharts/.github/actions/checkout@master'
with:
repository: 'regentmarkets/flutter-chart'
path: flutter-chart
ref: fe-changes
token: ${{ secrets.REPO_READ_TOKEN }}
- uses: subosito/flutter-action@88cab4064b0a5145b0b53b42565b68248a3d7bcb
with:
flutter-version: '3.10.6'
channel: 'stable'
cache: true
- name: Add SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/github_action_key
chmod 600 ~/.ssh/github_action_key
- name: Build flutter
env:
GIT_SSH_COMMAND: 'ssh -i ~/.ssh/github_action_key'
run: |
cd SmartCharts/chart_app
flutter pub get
flutter build web --web-renderer html --release
- name: Setup node
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8
with:
node-version: 20.x
registry-url: "https://registry.npmjs.org"
- name: Setup SmartCharts
run: cd SmartCharts && npm install
- name: Publish SmartCharts
run: cd SmartCharts && npm run build
- name: Prepublish SmartCharts
run: npm run prepublish
- name: Release SmartCharts
if: success()
env:
CI: true
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
update_chart_version_in_deriv_app:
runs-on: Ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- name: Checkout deriv-app
uses: 'binary-com/SmartCharts/.github/actions/checkout@master'
with:
repository: 'binary-com/deriv-app'
path: deriv-app
ref: master
- name: Get the new chart version
id: check_new_version
run: |
new_version=$(npm show @deriv/deriv-charts version)
echo "new_version=$new_version" >> $GITHUB_OUTPUT
- name: Update package.json
id: update_package_json
run: |
cd deriv-app
new_version=${{ steps.check_new_version.outputs.new_version }}
npm install @deriv/deriv-charts@$new_version
- name: Update trader package.json
run: |
cd deriv-app/packages/trader
new_version=${{ steps.check_new_version.outputs.new_version }}
npm install @deriv/deriv-charts@$new_version
- name: Update bot-web-ui package.json
run: |
cd deriv-app/packages/bot-web-ui
new_version=${{ steps.check_new_version.outputs.new_version }}
npm install @deriv/deriv-charts@$new_version
- name: Create Pull Request to deriv-app
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
commit-message: "chore: update @deriv/deriv-charts to ${{ steps.check_new_version.outputs.new_version }}"
title: "chore: update @deriv/deriv-charts to ${{ steps.check_new_version.outputs.new_version }}"
body: "This PR updates the @deriv/deriv-charts to ${{ steps.check_new_version.outputs.new_version }}"
branch: "chore/update-deriv-charts-to-${{ steps.check_new_version.outputs.new_version }}"
base: "master"