forked from leather-io/extension
-
Notifications
You must be signed in to change notification settings - Fork 4
117 lines (99 loc) · 3.5 KB
/
build-extension.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
name: PR Extensions builds
on: [pull_request, workflow_dispatch]
env:
COINBASE_APP_ID: ${{ secrets.COINBASE_APP_ID }}
MOONPAY_API_KEY: ${{ secrets.MOONPAY_API_KEY }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY_STAGING }}
TRANSAK_API_KEY: ${{ secrets.TRANSAK_API_KEY }}
WALLET_ENVIRONMENT: feature
jobs:
pre_run:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@ad6cb1b847ffb509a69b745b6ee2f1d14dfe14b8
with:
access_token: ${{ github.token }}
update-pull-request-body:
name: Add links to built extensions
# Don't run on forks
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
needs:
- pre_run
steps:
- uses: kyranjamie/[email protected]
with:
header: '> Try out this version of the Hiro Wallet - download [extension builds](https://github.com/hirosystems/stacks-wallet-web/actions/runs/${{ github.run_id }}).'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_chrome_extension:
name: Build Chrome extension
runs-on: ubuntu-latest
needs:
- pre_run
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
id: cache-node-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
- uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Install packages
uses: ./.github/actions/provision
if: steps.cache-node-modules.outputs.cache-hit != 'true'
- name: Build project
run: yarn build
- name: Build extension
run: sh build-ext.sh
- uses: actions/upload-artifact@v2
name: Upload Chrome Extension Zip
with:
name: stacks-wallet-chromium
path: stacks-wallet-chromium.zip
publish_firefox_beta:
name: Publish beta firefox extension
runs-on: ubuntu-latest
needs:
- pre_run
env:
MINIFY_PRODUCTION_BUILD: true
# only run on commits with message 'Version release' because this will often fail on PRs
# due to reasons out of our control in the Firefox submission process
if: github.event.pull_request.head.repo.full_name == github.repository && github.event.commits[0].message == 'Version release'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Set Node Version
uses: actions/setup-node@v2-beta
with:
node-version: 14.x
- name: Restore cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install yarn dependencies
run: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 yarn --frozen-lockfile
- name: Build project
run: yarn build
- name: Build extension
run: sh build-ext.sh
- name: Sign Firefox extension
run: yarn web-ext sign --channel=unlisted
env:
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}
- uses: actions/upload-artifact@v2
name: Upload Firefox Add-On XPI
with:
name: connect-addon
path: web-ext-artifacts/*.xpi