forked from argentlabs/argent-x
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (94 loc) · 3.34 KB
/
release.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
name: Release
on:
push:
tags:
- "v*.*.*"
branches:
- prerelease/*
env:
FEATURE_PRIVACY_SETTINGS: "true"
FEATURE_EXPERIMENTAL_SETTINGS: "true"
FEATURE_BANXA: "true"
FEATURE_LAYERSWAP: "true"
FEATURE_ORBITER: "true"
FEATURE_VERIFIED_DAPPS: "true"
FEATURE_ARGENT_SHIELD: "true"
ARGENT_SHIELD_NETWORK_ID: "mainnet-alpha"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
env:
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
FILENAME: argent-extension-${{ github.ref_name }}
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
RAMP_API_KEY: ${{ secrets.RAMP_API_KEY }}
UPLOAD_SENTRY_SOURCEMAPS: true
ARGENT_API_BASE_URL: ${{ secrets.ARGENT_API_BASE_URL }}
ARGENT_TRANSACTION_REVIEW_API_BASE_URL: ${{ secrets.ARGENT_TRANSACTION_REVIEW_API_BASE_URL }}
ARGENT_X_STATUS_URL: ${{ secrets.ARGENT_X_STATUS_URL }}
ARGENT_EXPLORER_BASE_URL: ${{ secrets.ARGENT_EXPLORER_BASE_URL }}
SAFE_ENV_VARS: true
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "yarn"
- run: yarn setup
- run: yarn build
- name: Release npm packages
# if flow is triggered by a tag, publish to npm
if: startsWith(github.ref, 'refs/tags/')
run: |
npm config set "//registry.npmjs.org/:_authToken" "$NPM_ACCESS_TOKEN"
cp Readme.md ./packages/get-starknet/README.md
yarn --cwd packages/get-starknet publish --access public || exit 0
yarn --cwd packages/sessions publish --access public || exit 0
- run: yarn --cwd packages/dapp export
- name: Check bundlesize for chrome
run: yarn run bundlewatch
- name: Create chrome zip
run: |
cd packages/extension/dist
zip -r $(echo "${{ env.FILENAME }}" | tr / -)-chrome.zip ./*
mv $(echo "${{ env.FILENAME }}" | tr / -)-chrome.zip ../../../
cd ../../../
- name: Build Firefox version
run: MANIFEST_VERSION=v2 yarn --cwd packages/extension build
- name: Create firefox zip
run: |
cd packages/extension/dist
zip -r $(echo "${{ env.FILENAME }}" | tr / -)-firefox.zip ./*
mv $(echo "${{ env.FILENAME }}" | tr / -)-firefox.zip ../../../
cd ../../../
- name: Check bundlesize for firefox
run: yarn run bundlewatch
- name: Upload artifacts for chrome
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v3
with:
name: chrome
path: "*-chrome.zip"
retention-days: 14
if-no-files-found: error
- name: Upload artifacts for firefox
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v3
with:
name: firefox
path: "*-firefox.zip"
retention-days: 14
if-no-files-found: error
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
${{ env.FILENAME }}-chrome.zip
${{ env.FILENAME }}-firefox.zip