Skip to content

Commit 13ca7b4

Browse files
authored
Merge pull request #2043 from argentlabs/release/v5.4
Release v5.4
2 parents 374ba0f + 1354894 commit 13ca7b4

File tree

899 files changed

+36458
-19273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

899 files changed

+36458
-19273
lines changed

.github/workflows/pull-request.yml

Lines changed: 113 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,31 @@ on:
55
- develop
66
pull_request:
77

8+
env:
9+
FEATURE_PRIVACY_SETTINGS: "true"
10+
FEATURE_EXPERIMENTAL_SETTINGS: "true"
11+
FEATURE_BANXA: "true"
12+
FEATURE_LAYERSWAP: "true"
13+
FEATURE_ORBITER: "true"
14+
FEATURE_VERIFIED_DAPPS: "true"
15+
FEATURE_ARGENT_SHIELD: "true"
16+
ARGENT_SHIELD_NETWORK_ID: "mainnet-alpha"
17+
FEATURE_MULTISIG: "false"
18+
19+
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
20+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
21+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
22+
RAMP_API_KEY: ${{ secrets.RAMP_API_KEY }}
23+
SAFE_ENV_VARS: true
24+
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
25+
ARGENT_TRANSACTION_REVIEW_API_BASE_URL: ${{ vars.ARGENT_TRANSACTION_REVIEW_API_BASE_URL }}
26+
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }}
27+
ARGENT_EXPLORER_BASE_URL: ${{ vars.ARGENT_EXPLORER_BASE_URL }}
28+
829
jobs:
930
setup:
1031
runs-on: ubuntu-latest
1132

12-
env:
13-
FEATURE_PRIVACY_SETTINGS: "true"
14-
FEATURE_EXPERIMENTAL_SETTINGS: "true"
15-
FEATURE_BANXA: "true"
16-
FEATURE_LAYERSWAP: "true"
17-
FEATURE_ORBITER: "true"
18-
FEATURE_VERIFIED_DAPPS: "false"
19-
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
20-
ARGENT_TRANSACTION_REVIEW_API_BASE_URL: ${{ vars.ARGENT_TRANSACTION_REVIEW_API_BASE_URL }}
21-
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }}
22-
ARGENT_EXPLORER_BASE_URL: ${{ vars.ARGENT_EXPLORER_BASE_URL }}
23-
UPLOAD_SENTRY_SOURCEMAPS: false
24-
2533
steps:
2634
- uses: actions/checkout@v3
2735
- uses: actions/setup-node@v3
@@ -35,12 +43,28 @@ jobs:
3543
- name: Build extension
3644
run: yarn lerna run --scope @argent-x/extension build
3745

46+
- name: Check bundlesize for Chrome
47+
run: yarn run bundlewatch
48+
3849
- name: Cache build
3950
uses: actions/cache@v3
4051
with:
4152
path: ./*
4253
key: ${{ github.sha }}
4354

55+
- name: Set filename prefix
56+
run: echo "FILENAME_PREFIX=$(echo argent-extension-${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV
57+
58+
- name: Create chrome zip
59+
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-chrome.zip" .)
60+
61+
- name: Upload Chrome extension
62+
uses: actions/upload-artifact@v3
63+
with:
64+
name: ${{ env.FILENAME_PREFIX }}-chrome.zip
65+
path: "*-chrome.zip"
66+
retention-days: 5
67+
4468
test-unit:
4569
runs-on: ubuntu-latest
4670
needs: [setup]
@@ -57,6 +81,7 @@ jobs:
5781
with:
5882
node-version: "16"
5983
cache: "yarn"
84+
fetch-depth: 0
6085

6186
- name: Restore cached build
6287
uses: actions/cache@v3
@@ -69,11 +94,23 @@ jobs:
6994

7095
- name: Run tests
7196
run: yarn test:ci
97+
- name: SonarCloud Scan
98+
# TODO replace with master as soon as sonarcloud fixes the issue with action https://community.sonarsource.com/t/sonarsource-sonarcloud-github-action-failing-with-node-js-12-error/89664/2
99+
uses: SonarSource/sonarcloud-github-action@v1.8
100+
with:
101+
projectBaseDir: ./packages/extension
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
72105

73106
test-e2e:
74107
runs-on: ubuntu-latest
75108
needs: [setup]
76-
109+
strategy:
110+
matrix:
111+
project: [chromium]
112+
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
113+
shardTotal: [8]
77114
services:
78115
devnet:
79116
image: argentlabs-argent-x.jfrog.io/e2e-starknet-devnet:latest
@@ -85,7 +122,6 @@ jobs:
85122

86123
steps:
87124
- uses: actions/checkout@v3
88-
89125
- uses: actions/setup-node@v3
90126
with:
91127
node-version: "16"
@@ -101,21 +137,22 @@ jobs:
101137
run: npx playwright install chromium
102138

103139
- name: Run e2e tests
104-
run: xvfb-run --auto-servernum yarn test:e2e
140+
run: xvfb-run --auto-servernum yarn test:e2e --project=${{ matrix.project }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
105141

106142
- name: Upload artifacts
107143
uses: actions/upload-artifact@v3
108144
if: always()
109145
with:
110146
name: test-results
111147
path: |
112-
packages/extension/test-results/
113-
packages/extension/e2e/artifacts/playwright/
114-
packages/extension/e2e/artifacts/reports/
148+
packages/test-results/
149+
packages/e2e/artifacts/playwright/
150+
packages/e2e/artifacts/reports/
115151
retention-days: 5
116152

117-
sonar:
153+
build_firefox_extension:
118154
runs-on: ubuntu-latest
155+
if: ${{ github.event_name == 'pull_request' }} # Run only for pull requests
119156
needs: [setup]
120157

121158
steps:
@@ -131,19 +168,35 @@ jobs:
131168
path: ./*
132169
key: ${{ github.sha }}
133170

134-
- name: SonarCloud Scan
135-
uses: SonarSource/sonarcloud-github-action@master
136-
env:
137-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138-
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
171+
- name: Build Firefox version
172+
run: MANIFEST_VERSION=v2 yarn --cwd packages/extension build
173+
174+
- name: Set filename prefix
175+
run: echo "FILENAME_PREFIX=$(echo argent-extension-${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV
176+
177+
- name: Create firefox zip
178+
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-firefox.zip" .)
179+
180+
- name: Check bundlesize for firefox
181+
run: yarn run bundlewatch
182+
183+
- name: Upload artifacts for firefox
184+
uses: actions/upload-artifact@v3
185+
with:
186+
name: ${{ env.FILENAME_PREFIX }}-firefox.zip
187+
path: "*-firefox.zip"
188+
retention-days: 5
139189

140-
artifacts:
190+
create_sentry_release:
141191
runs-on: ubuntu-latest
142-
if: ${{ github.event_name == 'pull_request' }} # Run only for pull requests
143-
needs: [setup, test-unit, test-e2e]
192+
if: ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'}} # Run only for pull requests and if not triggered by dependabot
193+
needs: [setup]
144194

145195
steps:
146196
- uses: actions/checkout@v3
197+
with:
198+
fetch-depth: 0
199+
147200
- uses: actions/setup-node@v3
148201
with:
149202
node-version: "16"
@@ -155,34 +208,43 @@ jobs:
155208
path: ./*
156209
key: ${{ github.sha }}
157210

158-
- name: Set filename prefix
159-
run: echo "FILENAME_PREFIX=$(echo argent-extension-${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV
211+
- name: Build extension
212+
run: yarn lerna run --scope @argent-x/extension build
160213

161-
- name: Create chrome zip
162-
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-chrome.zip" .)
214+
- name: Get Extension version
215+
id: package-version
216+
run: |
217+
PACKAGE_VERSION=$(cat ./packages/extension/package.json | jq -r '.version')
218+
echo "current-version=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT
163219
164-
- name: Upload artifacts for chrome
165-
uses: actions/upload-artifact@v3
220+
- name: Check sourcemaps
221+
run: |
222+
ls -l ./packages/extension
223+
if [ ! -d "./packages/extension/sourcemaps" ]; then
224+
echo "No sourcemaps found"
225+
exit 0
226+
fi
227+
228+
- name: Create Sentry release
229+
uses: getsentry/action-release@v1
230+
env:
231+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
232+
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
233+
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
234+
SENTRY_LOG_LEVEL: debug
166235
with:
167-
name: ${{ env.FILENAME_PREFIX }}-chrome.zip
168-
path: "*-chrome.zip"
169-
retention-days: 5
170-
171-
- name: Build Firefox version
172-
run: MANIFEST_VERSION=v2 yarn --cwd packages/extension build
236+
environment: staging
237+
sourcemaps: "./packages/extension/sourcemaps"
238+
version: ${{ steps.package-version.outputs.current-version }}-rc__${{ github.sha }}
239+
ignore_missing: true
173240

174-
- name: Create firefox zip
175-
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-firefox.zip" .)
176-
177-
- name: Check bundlesize for firefox
178-
run: yarn run bundlewatch
241+
add_pr_comments:
242+
runs-on: ubuntu-latest
243+
if: ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'}} # Run only for pull requests and if not triggered by dependabot
244+
needs: [build_firefox_extension, test-unit, test-e2e]
179245

180-
- name: Upload artifacts for firefox
181-
uses: actions/upload-artifact@v3
182-
with:
183-
name: ${{ env.FILENAME_PREFIX }}-firefox.zip
184-
path: "*-firefox.zip"
185-
retention-days: 5
246+
steps:
247+
- uses: actions/checkout@v3
186248

187249
- name: Set GHA_BRANCH
188250
run: echo "GHA_BRANCH=$(echo $GITHUB_REF | awk -F / '{print $3}')" >> $GITHUB_ENV

.github/workflows/release.yml

Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- "v*.*.*"
6+
- "extension/*"
77

88
env:
99
FEATURE_PRIVACY_SETTINGS: "true"
@@ -14,33 +14,33 @@ env:
1414
FEATURE_VERIFIED_DAPPS: "true"
1515
FEATURE_ARGENT_SHIELD: "true"
1616
ARGENT_SHIELD_NETWORK_ID: "mainnet-alpha"
17+
FEATURE_MULTISIG: "false"
18+
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
19+
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
20+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
21+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
22+
RAMP_API_KEY: ${{ secrets.RAMP_API_KEY }}
23+
FILENAME: argent-extension
24+
SAFE_ENV_VARS: true
25+
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
26+
ARGENT_TRANSACTION_REVIEW_API_BASE_URL: ${{ vars.ARGENT_TRANSACTION_REVIEW_API_BASE_URL }}
27+
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }}
28+
ARGENT_EXPLORER_BASE_URL: ${{ vars.ARGENT_EXPLORER_BASE_URL }}
1729

1830
jobs:
1931
build:
2032
runs-on: ubuntu-latest
2133
permissions:
2234
contents: write
23-
env:
24-
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
25-
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
26-
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
27-
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
28-
RAMP_API_KEY: ${{ secrets.RAMP_API_KEY }}
29-
FILENAME: argent-extension-${{ github.ref_name }}
30-
UPLOAD_SENTRY_SOURCEMAPS: true
31-
SAFE_ENV_VARS: true
32-
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
33-
ARGENT_TRANSACTION_REVIEW_API_BASE_URL: ${{ vars.ARGENT_TRANSACTION_REVIEW_API_BASE_URL }}
34-
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }}
35-
ARGENT_EXPLORER_BASE_URL: ${{ vars.ARGENT_EXPLORER_BASE_URL }}
35+
3636
steps:
3737
- uses: actions/checkout@v3
3838
- uses: actions/setup-node@v3
3939
with:
4040
node-version: "16"
4141
cache: "yarn"
4242
- run: yarn setup
43-
- run: yarn build
43+
- run: yarn build --ignore @argent/web
4444

4545
- name: Release npm packages
4646
# if flow is triggered by a tag, publish to npm
@@ -69,7 +69,6 @@ jobs:
6969
run: yarn run bundlewatch
7070

7171
- name: Upload artifacts for chrome
72-
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
7372
uses: actions/upload-artifact@v3
7473
with:
7574
name: chrome
@@ -78,14 +77,45 @@ jobs:
7877
if-no-files-found: error
7978

8079
- name: Upload artifacts for firefox
81-
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
8280
uses: actions/upload-artifact@v3
8381
with:
8482
name: firefox
8583
path: "*-firefox.zip"
8684
retention-days: 14
8785
if-no-files-found: error
8886

87+
- uses: actions/checkout@v3
88+
with:
89+
fetch-depth: 0
90+
91+
- name: Get Extension version
92+
id: package-version
93+
run: |
94+
PACKAGE_VERSION=$(cat ./packages/extension/package.json | jq -r '.version')
95+
echo "current-version=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT
96+
97+
- name: Check sourcemaps
98+
run: |
99+
ls -l ./packages/extension
100+
if [ ! -d "./packages/extension/sourcemaps" ]; then
101+
echo "No sourcemaps found"
102+
exit 0
103+
fi
104+
105+
- name: Create Sentry release
106+
uses: getsentry/action-release@v1
107+
env:
108+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
109+
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
110+
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
111+
SENTRY_LOG_LEVEL: debug
112+
with:
113+
environment: production
114+
sourcemaps: "./packages/extension/sourcemaps"
115+
url_prefix: "~/sourcemaps"
116+
version: ${{ steps.package-version.outputs.current-version }}
117+
ignore_missing: true
118+
89119
- name: Release
90120
if: startsWith(github.ref, 'refs/tags/')
91121
uses: softprops/action-gh-release@v1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ sourcemaps
1515
coverage
1616
*.tsbuildinfo
1717
license-report.md
18+
19+
**/.next

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["svelte.svelte-vscode"]
3+
}

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@
88
"**/.{idea,git,cache,output,temp}/**"
99
],
1010
"vitest.enable": true,
11-
"vitest.commandLine": "npx vitest -r packages/extension/"
11+
"vitest.commandLine": "npx vitest -r packages/extension/",
12+
"explorer.fileNesting.patterns": {
13+
"*.tsx": "${capture}.ts, ${capture}.typegen.ts, ${capture}Container.tsx, ${capture}.container.tsx, ${capture}.test.tsx, ${capture}.spec.tsx, ${capture}.test.ts, ${capture}.spec.ts",
14+
"*.ts": "${capture}.ts, ${capture}.typegen.ts, ${capture}Container.tsx, ${capture}.container.tsx, ${capture}.test.tsx, ${capture}.spec.tsx, ${capture}.test.ts, ${capture}.spec.ts"
15+
}
1216
}

Readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
</a>
1414
</p>
1515

16+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=argentlabs_argent-x-private&metric=alert_status&token=37f8b93db6e967b7992252f0e70c62ff6da11bbb)](https://sonarcloud.io/summary/new_code?id=argentlabs_argent-x-private) [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=argentlabs_argent-x-private&metric=sqale_index&token=37f8b93db6e967b7992252f0e70c62ff6da11bbb)](https://sonarcloud.io/summary/new_code?id=argentlabs_argent-x-private) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=argentlabs_argent-x-private&metric=coverage&token=37f8b93db6e967b7992252f0e70c62ff6da11bbb)](https://sonarcloud.io/summary/new_code?id=argentlabs_argent-x-private)
17+
1618
---
1719

1820
<h2>🌈 Table of contents</h2>

0 commit comments

Comments
 (0)