Skip to content

Commit

Permalink
feat: sf 613 add cicd support for alchemy (#237)
Browse files Browse the repository at this point in the history
* feat: bump starknetjs to 6.6.0

* chore: remove unuse script

* chore: add default config

* chore: remove patching

* chore: update library version

* chore: update getStarkName

* feat: add alchemy provider

* fix: add cicd pipeline
  • Loading branch information
stanleyyconsensys authored May 1, 2024
1 parent 499f59d commit 033fdc6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,15 @@ jobs:
REACT_APP_SNAP_VERSION=${VERSION}-staging yarn workspace wallet-ui build
npm --prefix ./packages/starknet-snap version --new-version ${VERSION}-staging --no-git-tag-version
SNAP_ENV=staging VOYAGER_API_KEY=${{ secrets.VOYAGER_API_KEY }} yarn workspace @consensys/starknet-snap build
yarn workspace @consensys/starknet-snap build
npm publish ./packages/starknet-snap --tag staging --access public 2>&1 > /dev/null || :
aws s3 sync ./packages/wallet-ui/build s3://staging.snaps.consensys.io/starknet
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
SNAP_ENV: staging
VOYAGER_API_KEY: ${{ secrets.VOYAGER_API_KEY }}
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
if: inputs.environment == 'staging'

- name: Production Deployment
Expand All @@ -62,12 +65,15 @@ jobs:
REACT_APP_SNAP_VERSION=${VERSION} REACT_APP_DEBUG_LEVEL=off yarn workspace wallet-ui build
npm --prefix ./packages/starknet-snap version --new-version ${VERSION} --no-git-tag-version --allow-same-version
SNAP_ENV=prod VOYAGER_API_KEY=${{ secrets.VOYAGER_API_KEY }} yarn workspace @consensys/starknet-snap build
yarn workspace @consensys/starknet-snap build
npm publish ./packages/starknet-snap --tag latest --access public 2>&1 > /dev/null || :
aws s3 sync ./packages/wallet-ui/build s3://snaps.consensys.io/starknet
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
SNAP_ENV: prod
VOYAGER_API_KEY: ${{ secrets.VOYAGER_API_KEY }}
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
if: inputs.environment == 'production'

- name: invalid aws cloudfront cache
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/publish-npm-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
publish-dev-to-npm:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3
- run: |
yarn install --no-immutable
Expand All @@ -24,7 +23,11 @@ jobs:
HASH=$(git rev-parse --short HEAD)
DATE=$(date +%Y%m%d)
npm --prefix ./packages/starknet-snap version --new-version ${VERSION}-dev-${HASH}-${DATE} --no-git-tag-version
SNAP_ENV=dev VOYAGER_API_KEY=${{ secrets.VOYAGER_API_KEY }} yarn workspace @consensys/starknet-snap build
yarn workspace @consensys/starknet-snap build
env:
SNAP_ENV: dev
VOYAGER_API_KEY: ${{ secrets.VOYAGER_API_KEY }}
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
- uses: actions/setup-node@v3
with:
Expand Down
11 changes: 11 additions & 0 deletions packages/starknet-snap/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Description: Environment variables for snap env
# Possible Options: dev | prod | staging
# Default: prod
# Required: false
SNAP_ENV=dev
# Description: Environment variables for API key of VOYAGER
# Required: false
VOYAGER_API_KEY=
# Description: Environment variables for API key of ALCHEMY
# Required: false
ALCHEMY_API_KEY=
10 changes: 7 additions & 3 deletions packages/starknet-snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@
"name": "@consensys/starknet-snap",
"version": "2.6.2",
"license": "(Apache-2.0 OR MIT)",
"main": "src/index.ts",
"repository": {
"type": "git",
"url": "https://github.com/ConsenSys/starknet-snap.git"
},
"main": "./dist/bundle.js",
"files": [
"dist/",
"images/",
"snap.manifest.json"
],
"scripts": {
"setup": "yarn install --immutable && yarn allow-scripts",
"build:clean": "yarn clean && yarn build",
"build": "mm-snap build",
"serve": "mm-snap serve",
"clean": "rimraf js && rimraf dist",
"watch": "yarn build && concurrently --kill-others --names SNAP,SERVE -c bgMagenta.bold,bgGreen.bold \"yarn run watch:snap\" \"yarn run serve\"",
"watch:snap": "cross-env SNAP_ENV=prod mm-snap watch",
"watch": "mm-snap watch",
"prettier": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint": "eslint . --max-warnings 0 -f json -o eslint-report.json",
"lint:fix": "eslint '**/*.{js,ts,tsx}' --fix",
Expand Down

0 comments on commit 033fdc6

Please sign in to comment.