-
Notifications
You must be signed in to change notification settings - Fork 7
166 lines (143 loc) · 5.57 KB
/
build.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Build
on:
push:
branches:
# - develop
- feat/for_desktop
- feat/for_desktop*
tags:
- '*'
defaults:
run:
shell: bash -leo pipefail {0}
jobs:
# Prepare node modules. Reuse cache if available
setup:
name: prepare build
runs-on: [self-hosted, X64, Linux, webextension, builder]
env:
NODE_OPTIONS: '--max_old_space_size=4096'
steps:
- name: checkout
uses: actions/checkout@v3
- name: Env Test
id: env-test
run: |
echo "whoami $(whoami)"
echo "shell is $(echo $0)"
echo "which node $(which node)"
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '18.20.4'
# - name: Get yarn cache directory path
# id: yarn-cache-dir-path
# run: echo "::set-output name=dir::$(yarn cache dir)"
# - uses: actions/cache@v3
# id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# - uses: actions/cache@v3
# id: yarn-node_modules # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
# with:
# path: node_modules
# key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
# - name: Get Yarn Cache
# if: steps.yarn-cache.outputs.cache-hit == 'true'
# run: yarn --prefer-offline
- name: Use NPM Token with organization read access
uses: heisenberg-2077/use-npm-token-action@v1
with:
token: '${{ secrets.NPM_AUTH_TOKEN }}'
# - name: Install Dependencies
# if: steps.yarn-cache.outputs.cache-hit != 'true'
# run: yarn install --frozen-lockfile
build-pro:
name: build pro
runs-on: [self-hosted, X64, Linux, webextension, builder]
needs: setup
env:
NODE_OPTIONS: '--max_old_space_size=4096'
steps:
- name: checkout
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v3
id: yarn-node_modules # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('patches/*.patch') }}
- name: build
run: |
sh ./scripts/pack.sh;
env:
RABBY_BUILD_BUCKET: ${{ secrets.RABBY_BUILD_BUCKET }}
LARK_CHAT_URL: ${{ secrets.LARK_CHAT_URL }}
LARK_CHAT_SECRET: ${{ secrets.LARK_CHAT_SECRET }}
# see more details on https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
ACTIONS_JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
GIT_COMMIT_URL: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}
GIT_REF_NAME: ${{ github.ref_name }}
GIT_REF_URL: ${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TRIGGERING_ACTOR: ${{ github.triggering_actor }}
# - name: Upload artifact
# uses: actions/upload-artifact@v3
# if: ${{ github.event_name == 'pull_request' }}
# with:
# name: Rabby_${{github.sha}}
# path: dist
# retention-days: 7
# - name: Upload artifact
# uses: actions/upload-artifact@v3
# if: ${{ github.event_name == 'push' }}
# with:
# name: Rabby_${{github.ref_name}}
# path: dist
# retention-days: 7
# build-debug:
# name: build debug
# runs-on: [self-hosted, X64, Linux, builder]
# needs: setup
# env:
# NODE_OPTIONS: '--max_old_space_size=4096'
# steps:
# - name: checkout
# uses: actions/checkout@v3
# - name: Get yarn cache directory path
# id: yarn-cache-dir-path
# run: echo "::set-output name=dir::$(yarn cache dir)"
# - uses: actions/cache@v3
# id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# - uses: actions/cache@v3
# id: yarn-node_modules # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
# with:
# path: node_modules
# key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
# - name: build
# run: yarn build:debug
# - name: Upload artifact
# uses: actions/upload-artifact@v3
# if: ${{ github.event_name == 'pull_request' }}
# with:
# name: Rabby_${{github.sha}}_debug
# path: dist
# retention-days: 7
# - name: Upload artifact
# uses: actions/upload-artifact@v3
# if: ${{ github.event_name == 'push' }}
# with:
# name: Rabby_${{github.ref_name}}_debug
# path: dist
# retention-days: 7