Skip to content

Commit

Permalink
Merge pull request #2043 from argentlabs/release/v5.4
Browse files Browse the repository at this point in the history
Release v5.4
  • Loading branch information
gergold authored May 25, 2023
2 parents 374ba0f + 1354894 commit 13ca7b4
Show file tree
Hide file tree
Showing 899 changed files with 36,458 additions and 19,273 deletions.
164 changes: 113 additions & 51 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,31 @@ on:
- develop
pull_request:

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"
FEATURE_MULTISIG: "false"

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 }}
SAFE_ENV_VARS: true
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
ARGENT_TRANSACTION_REVIEW_API_BASE_URL: ${{ vars.ARGENT_TRANSACTION_REVIEW_API_BASE_URL }}
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }}
ARGENT_EXPLORER_BASE_URL: ${{ vars.ARGENT_EXPLORER_BASE_URL }}

jobs:
setup:
runs-on: ubuntu-latest

env:
FEATURE_PRIVACY_SETTINGS: "true"
FEATURE_EXPERIMENTAL_SETTINGS: "true"
FEATURE_BANXA: "true"
FEATURE_LAYERSWAP: "true"
FEATURE_ORBITER: "true"
FEATURE_VERIFIED_DAPPS: "false"
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
ARGENT_TRANSACTION_REVIEW_API_BASE_URL: ${{ vars.ARGENT_TRANSACTION_REVIEW_API_BASE_URL }}
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }}
ARGENT_EXPLORER_BASE_URL: ${{ vars.ARGENT_EXPLORER_BASE_URL }}
UPLOAD_SENTRY_SOURCEMAPS: false

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -35,12 +43,28 @@ jobs:
- name: Build extension
run: yarn lerna run --scope @argent-x/extension build

- name: Check bundlesize for Chrome
run: yarn run bundlewatch

- name: Cache build
uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}

- name: Set filename prefix
run: echo "FILENAME_PREFIX=$(echo argent-extension-${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV

- name: Create chrome zip
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-chrome.zip" .)

- name: Upload Chrome extension
uses: actions/upload-artifact@v3
with:
name: ${{ env.FILENAME_PREFIX }}-chrome.zip
path: "*-chrome.zip"
retention-days: 5

test-unit:
runs-on: ubuntu-latest
needs: [setup]
Expand All @@ -57,6 +81,7 @@ jobs:
with:
node-version: "16"
cache: "yarn"
fetch-depth: 0

- name: Restore cached build
uses: actions/cache@v3
Expand All @@ -69,11 +94,23 @@ jobs:

- name: Run tests
run: yarn test:ci
- name: SonarCloud Scan
# 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
uses: SonarSource/[email protected]
with:
projectBaseDir: ./packages/extension
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}

test-e2e:
runs-on: ubuntu-latest
needs: [setup]

strategy:
matrix:
project: [chromium]
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
shardTotal: [8]
services:
devnet:
image: argentlabs-argent-x.jfrog.io/e2e-starknet-devnet:latest
Expand All @@ -85,7 +122,6 @@ jobs:

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: "16"
Expand All @@ -101,21 +137,22 @@ jobs:
run: npx playwright install chromium

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

- name: Upload artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: |
packages/extension/test-results/
packages/extension/e2e/artifacts/playwright/
packages/extension/e2e/artifacts/reports/
packages/test-results/
packages/e2e/artifacts/playwright/
packages/e2e/artifacts/reports/
retention-days: 5

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

steps:
Expand All @@ -131,19 +168,35 @@ jobs:
path: ./*
key: ${{ github.sha }}

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
- name: Build Firefox version
run: MANIFEST_VERSION=v2 yarn --cwd packages/extension build

- name: Set filename prefix
run: echo "FILENAME_PREFIX=$(echo argent-extension-${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV

- name: Create firefox zip
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-firefox.zip" .)

- name: Check bundlesize for firefox
run: yarn run bundlewatch

- name: Upload artifacts for firefox
uses: actions/upload-artifact@v3
with:
name: ${{ env.FILENAME_PREFIX }}-firefox.zip
path: "*-firefox.zip"
retention-days: 5

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

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: "16"
Expand All @@ -155,34 +208,43 @@ jobs:
path: ./*
key: ${{ github.sha }}

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

- name: Create chrome zip
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-chrome.zip" .)
- name: Get Extension version
id: package-version
run: |
PACKAGE_VERSION=$(cat ./packages/extension/package.json | jq -r '.version')
echo "current-version=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT
- name: Upload artifacts for chrome
uses: actions/upload-artifact@v3
- name: Check sourcemaps
run: |
ls -l ./packages/extension
if [ ! -d "./packages/extension/sourcemaps" ]; then
echo "No sourcemaps found"
exit 0
fi
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_LOG_LEVEL: debug
with:
name: ${{ env.FILENAME_PREFIX }}-chrome.zip
path: "*-chrome.zip"
retention-days: 5

- name: Build Firefox version
run: MANIFEST_VERSION=v2 yarn --cwd packages/extension build
environment: staging
sourcemaps: "./packages/extension/sourcemaps"
version: ${{ steps.package-version.outputs.current-version }}-rc__${{ github.sha }}
ignore_missing: true

- name: Create firefox zip
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-firefox.zip" .)

- name: Check bundlesize for firefox
run: yarn run bundlewatch
add_pr_comments:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'}} # Run only for pull requests and if not triggered by dependabot
needs: [build_firefox_extension, test-unit, test-e2e]

- name: Upload artifacts for firefox
uses: actions/upload-artifact@v3
with:
name: ${{ env.FILENAME_PREFIX }}-firefox.zip
path: "*-firefox.zip"
retention-days: 5
steps:
- uses: actions/checkout@v3

- name: Set GHA_BRANCH
run: echo "GHA_BRANCH=$(echo $GITHUB_REF | awk -F / '{print $3}')" >> $GITHUB_ENV
Expand Down
64 changes: 47 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
tags:
- "v*.*.*"
- "extension/*"

env:
FEATURE_PRIVACY_SETTINGS: "true"
Expand All @@ -14,33 +14,33 @@ env:
FEATURE_VERIFIED_DAPPS: "true"
FEATURE_ARGENT_SHIELD: "true"
ARGENT_SHIELD_NETWORK_ID: "mainnet-alpha"
FEATURE_MULTISIG: "false"
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
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 }}
FILENAME: argent-extension
SAFE_ENV_VARS: true
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
ARGENT_TRANSACTION_REVIEW_API_BASE_URL: ${{ vars.ARGENT_TRANSACTION_REVIEW_API_BASE_URL }}
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }}
ARGENT_EXPLORER_BASE_URL: ${{ vars.ARGENT_EXPLORER_BASE_URL }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
env:
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
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 }}
FILENAME: argent-extension-${{ github.ref_name }}
UPLOAD_SENTRY_SOURCEMAPS: true
SAFE_ENV_VARS: true
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
ARGENT_TRANSACTION_REVIEW_API_BASE_URL: ${{ vars.ARGENT_TRANSACTION_REVIEW_API_BASE_URL }}
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }}
ARGENT_EXPLORER_BASE_URL: ${{ vars.ARGENT_EXPLORER_BASE_URL }}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"
cache: "yarn"
- run: yarn setup
- run: yarn build
- run: yarn build --ignore @argent/web

- name: Release npm packages
# if flow is triggered by a tag, publish to npm
Expand Down Expand Up @@ -69,7 +69,6 @@ jobs:
run: yarn run bundlewatch

- name: Upload artifacts for chrome
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v3
with:
name: chrome
Expand All @@ -78,14 +77,45 @@ jobs:
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

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get Extension version
id: package-version
run: |
PACKAGE_VERSION=$(cat ./packages/extension/package.json | jq -r '.version')
echo "current-version=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT
- name: Check sourcemaps
run: |
ls -l ./packages/extension
if [ ! -d "./packages/extension/sourcemaps" ]; then
echo "No sourcemaps found"
exit 0
fi
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_LOG_LEVEL: debug
with:
environment: production
sourcemaps: "./packages/extension/sourcemaps"
url_prefix: "~/sourcemaps"
version: ${{ steps.package-version.outputs.current-version }}
ignore_missing: true

- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ sourcemaps
coverage
*.tsbuildinfo
license-report.md

**/.next
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["svelte.svelte-vscode"]
}
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@
"**/.{idea,git,cache,output,temp}/**"
],
"vitest.enable": true,
"vitest.commandLine": "npx vitest -r packages/extension/"
"vitest.commandLine": "npx vitest -r packages/extension/",
"explorer.fileNesting.patterns": {
"*.tsx": "${capture}.ts, ${capture}.typegen.ts, ${capture}Container.tsx, ${capture}.container.tsx, ${capture}.test.tsx, ${capture}.spec.tsx, ${capture}.test.ts, ${capture}.spec.ts",
"*.ts": "${capture}.ts, ${capture}.typegen.ts, ${capture}Container.tsx, ${capture}.container.tsx, ${capture}.test.tsx, ${capture}.spec.tsx, ${capture}.test.ts, ${capture}.spec.ts"
}
}
2 changes: 2 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
</a>
</p>

[![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)

---

<h2>🌈 Table of contents</h2>
Expand Down
Loading

0 comments on commit 13ca7b4

Please sign in to comment.