forked from starknet-io/get-starknet
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (46 loc) · 1.89 KB
/
github-page-prod.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
name: Deploy to GitHub Pages (Prod)
on:
workflow_dispatch:
inputs:
branch:
description: "Branch to deploy from"
required: true
default: "main"
permissions:
id-token: write
contents: read
pages: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }} # Use the selected branch
- name: Set up Node.js (required if you're using a static site generator)
uses: actions/setup-node@v2
with:
node-version: "20"
- name: Perform Code Update
run: |
# Fetch the dev version using curl
VERSION=$(curl -s https://registry.npmjs.org/-/package/@consensys/starknet-snap/dist-tags | jq -r '.dev')
# Update the URL in the file (ensure we use -i for in-place replacement)
sed -i 's|https://snaps.consensys.io/starknet/get-starknet/v1/remoteEntry.js|https://dev.snaps.consensys.io/starknet/get-starknet/v1/remoteEntry.js|g' ./packages/core/src/wallet/virtualWallets/metaMaskVirtualWallet.ts
# Update the MetaMaskSnapWallet line with the new version
sed -i "s|const wallet = new MetaMaskSnapWallet(metaMaskVirtualWallet.provider, \"\*\")|const wallet = new MetaMaskSnapWallet(metaMaskVirtualWallet.provider, \"$VERSION\")|g" ./packages/core/src/wallet/virtualWallets/metaMaskVirtualWallet.ts
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies with pnpm
run: pnpm install --no-frozen-lockfile
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload Artifact
uses: actions/upload-pages-artifact@v2
with:
# upload entire directory
path: "./e2e/dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2