Skip to content

Commit

Permalink
Merge branch 'main' into feat/event-handling-with-polling
Browse files Browse the repository at this point in the history
  • Loading branch information
khanti42 authored Dec 2, 2024
2 parents 945e343 + 464d65c commit e9c52c2
Show file tree
Hide file tree
Showing 37 changed files with 565 additions and 1,559 deletions.
104 changes: 95 additions & 9 deletions .github/workflows/deploy-wallet-get-starknet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Deploy Wallet-UI and Get-starknet

on:
workflow_dispatch:

jobs:
prepare-deployment:
environment: production
Expand All @@ -20,21 +21,17 @@ jobs:
id: prepare_parameters
run: |
BASE=$(node -p "require('./packages/starknet-snap/package.json').version")
ENV=production
{
echo "VERSION=${BASE}"
echo "ENV=prod"
echo "AWS_CLOUDFRONT_DISTRIBUTIONS_ID=${{ vars.AWS_CLOUDFRONT_DISTRIBUTIONS_ID }}"
echo "AWS_S3_GET_STARKNET_URL=${{ vars.AWS_S3_GET_STARKNET_URL }}"
echo "AWS_S3_URL=${{ vars.AWS_S3_URL }}"
echo "GET_STARKNET_PUBLIC_PATH=${{ vars.GET_STARKNET_PUBLIC_PATH }}"
echo "VERSION=${BASE}"
echo "TAG=latest"
echo "ENV=prod"
} >> "$GITHUB_OUTPUT"
outputs:
VERSION: ${{ steps.prepare_parameters.outputs.VERSION }}
TAG: ${{ steps.prepare_parameters.outputs.TAG }}
ENV: ${{ steps.prepare_parameters.outputs.ENV }}
AWS_S3_GET_STARKNET_URL: ${{ steps.prepare_parameters.outputs.AWS_S3_GET_STARKNET_URL }}
AWS_CLOUDFRONT_DISTRIBUTIONS_ID: ${{ steps.prepare_parameters.outputs.AWS_CLOUDFRONT_DISTRIBUTIONS_ID }}
AWS_S3_URL: ${{ steps.prepare_parameters.outputs.AWS_S3_URL }}
Expand Down Expand Up @@ -67,7 +64,7 @@ jobs:
echo "Building Get Starknet with GET_STARKNET_PUBLIC_PATH=$GET_STARKNET_PUBLIC_PATH"
SNAP_VERSION="${VERSION}$" GET_STARKNET_PUBLIC_PATH=$GET_STARKNET_PUBLIC_PATH yarn workspace @consensys/get-starknet build
SNAP_VERSION="${VERSION}" GET_STARKNET_PUBLIC_PATH=$GET_STARKNET_PUBLIC_PATH yarn workspace @consensys/get-starknet build
env:
VERSION: ${{ needs.prepare-deployment.outputs.VERSION }}
GET_STARKNET_PUBLIC_PATH: ${{ needs.prepare-deployment.outputs.GET_STARKNET_PUBLIC_PATH }}
Expand All @@ -79,4 +76,93 @@ jobs:
./packages/get-starknet/dist/webpack
./packages/wallet-ui/build
./node_modules/.yarn-state.yml
key: ${{ needs.prepare-deployment.outputs.CACHE_KEY }}
key: ${{ needs.prepare-deployment.outputs.CACHE_KEY }}

deploy-wallet-ui:
runs-on: ubuntu-latest
needs:
- prepare-deployment
- install-build
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
- uses: actions/checkout@v3
with:
ref: ${{ github.sha }}
- name: Restore Cached Build
uses: actions/cache@v3
id: restore-build
with:
path: |
./packages/get-starknet/dist/webpack
./packages/wallet-ui/build
./node_modules/.yarn-state.yml
key: ${{ needs.prepare-deployment.outputs.CACHE_KEY }}
- name: Deploy to AWS
run: |
echo "Deployed Dapp to : $AWS_S3_URL"
aws s3 sync ./packages/wallet-ui/build "$AWS_S3_URL"
env:
AWS_S3_URL: ${{ needs.prepare-deployment.outputs.AWS_S3_URL }}

deploy-get-starknet:
runs-on: ubuntu-latest
needs:
- prepare-deployment
- install-build
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
- uses: actions/checkout@v3
with:
ref: ${{ github.sha }}
- name: Restore Cached Build
uses: actions/cache@v3
id: restore-build
with:
path: |
./packages/get-starknet/dist/webpack
./packages/wallet-ui/build
./node_modules/.yarn-state.yml
key: ${{ needs.prepare-deployment.outputs.CACHE_KEY }}
- name: Deploy to AWS
run: |
echo "Deployed get Starknet to : $AWS_S3_GET_STARKNET_URL"
aws s3 sync ./packages/get-starknet/dist/webpack "$AWS_S3_GET_STARKNET_URL"
env:
AWS_S3_GET_STARKNET_URL: ${{ needs.prepare-deployment.outputs.AWS_S3_GET_STARKNET_URL }}

invalid-aws-cdn-cache:
runs-on: ubuntu-latest
needs:
- deploy-wallet-ui
- deploy-get-starknet
- prepare-deployment
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
- name: Invalid AWS CDN Cache
run: |
echo "Distribution ID : $AWS_CLOUDFRONT_DISTRIBUTIONS_ID"
echo "$AWS_CLOUDFRONT_DISTRIBUTIONS_ID" | tr ',' '\n' | while read -r DISTRIBUTIONS_ID
do
echo "Processing Distribution ID : $DISTRIBUTIONS_ID"
INVALIDED_ID="$(aws cloudfront create-invalidation --distribution-id "$DISTRIBUTIONS_ID" --paths "/starknet/*" | grep Id | awk -F'"' '{ print $4}')"
echo "Waiting for invalidation $INVALIDED_ID"
aws cloudfront wait invalidation-completed --id "$INVALIDED_ID" --distribution-id "$DISTRIBUTIONS_ID"
echo "Invalidation $INVALIDED_ID completed"
done
env:
AWS_CLOUDFRONT_DISTRIBUTIONS_ID: ${{ needs.prepare-deployment.outputs.AWS_CLOUDFRONT_DISTRIBUTIONS_ID }}
37 changes: 34 additions & 3 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Publish NPM

on:
workflow_dispatch:

jobs:
prepare-deployment:
environment: production
Expand All @@ -20,8 +21,7 @@ jobs:
id: prepare_parameters
run: |
BASE=$(node -p "require('./packages/starknet-snap/package.json').version")
ENV=production
{
echo "VERSION=${BASE}"
echo "TAG=latest"
Expand Down Expand Up @@ -113,4 +113,35 @@ jobs:
run: |
npm pack ./packages/starknet-snap --tag "$TAG" --access public
env:
TAG: ${{ needs.prepare-deployment.outputs.TAG }}
TAG: ${{ needs.prepare-deployment.outputs.TAG }}

publish-npm:
runs-on: ubuntu-latest
needs:
- publish-npm-dry-run
- prepare-deployment
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.sha }}
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Restore Cached Build
uses: actions/cache@v3
id: restore-build
with:
# add /packages/snap/snap.manifest.json to include an updated shasum from build due to version update in auto PR
path: |
./packages/starknet-snap/package.json
./packages/starknet-snap/dist
./packages/starknet-snap/snap.manifest.json
./node_modules/.yarn-state.yml
key: ${{ needs.prepare-deployment.outputs.CACHE_KEY }}
- name: Run Publish
run: |
npm publish ./packages/starknet-snap --tag "$TAG" --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
TAG: ${{ needs.prepare-deployment.outputs.TAG }}
4 changes: 2 additions & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packages/starknet-snap": "2.11.0",
"packages/wallet-ui": "1.24.1",
"packages/starknet-snap": "3.0.0",
"packages/wallet-ui": "1.25.0",
"packages/get-starknet": "1.3.0"
}
2 changes: 2 additions & 0 deletions packages/get-starknet/webpack.config.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ module.exports = (env) =>
merge(common, {
mode: 'production',
output: {
filename: '[name].[contenthash].js?v=[fullhash]', // Appends a cache-busting query string
chunkFilename: '[name].[contenthash].js?v=[fullhash]', // For dynamically imported chunks
publicPath: process.env.GET_STARKNET_PUBLIC_PATH || 'https://snaps.consensys.io/starknet/get-starknet/v1/',
},
plugins: [
Expand Down
11 changes: 11 additions & 0 deletions packages/starknet-snap/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [3.0.0](https://github.com/Consensys/starknet-snap/compare/starknet-snap-v2.11.0...starknet-snap-v3.0.0) (2024-11-26)


### ⚠ BREAKING CHANGES

* Enable JSX support, 1) Allow users to select the fee token in the execute transaction dialog (#417, #418, #419, #420). 2) Add JSX support and detection (#415, #416). 3) Replace RPC dialogs with JSX-based components ([#422](https://github.com/Consensys/starknet-snap/issues/422))

### Features

* Enable JSX support, 1) Allow users to select the fee token in the execute transaction dialog ([#417](https://github.com/Consensys/starknet-snap/issues/417), [#418](https://github.com/Consensys/starknet-snap/issues/418), [#419](https://github.com/Consensys/starknet-snap/issues/419), [#420](https://github.com/Consensys/starknet-snap/issues/420)). 2) Add JSX support and detection ([#415](https://github.com/Consensys/starknet-snap/issues/415), [#416](https://github.com/Consensys/starknet-snap/issues/416)). 3) Replace RPC dialogs with JSX-based components ([#422](https://github.com/Consensys/starknet-snap/issues/422)) ([abfc0e5](https://github.com/Consensys/starknet-snap/commit/abfc0e52cc5c9c4fc7ec7e04a9ff667acbf99813))

## [2.11.0](https://github.com/Consensys/starknet-snap/compare/starknet-snap-v2.10.1...starknet-snap-v2.11.0) (2024-10-28)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"openrpc": "1.0.0-rc1",
"info": {
"version": "2.11.0",
"version": "3.0.0",
"title": "Starknet MetaMask Snap API",
"license": {}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/starknet-snap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@consensys/starknet-snap",
"version": "2.11.0",
"version": "3.0.0",
"keywords": [],
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/starknet-snap/snap.manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.11.0",
"version": "3.0.0",
"description": "Manage Starknet accounts and assets with MetaMask.",
"proposedName": "Starknet",
"repository": {
Expand Down
142 changes: 0 additions & 142 deletions packages/starknet-snap/src/estimateFee.ts

This file was deleted.

Loading

0 comments on commit e9c52c2

Please sign in to comment.