Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit d9cf995

Browse files
committed
release
1 parent 7b317c5 commit d9cf995

File tree

60 files changed

+762
-72
lines changed

Some content is hidden

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

60 files changed

+762
-72
lines changed
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Master
1+
name: Main
22
on:
33
push:
44
branches:
5-
- master
5+
- main
66

77
jobs:
8-
master:
8+
main:
99
if: "! startsWith(github.event.head_commit.message, '[CI Skip]')"
1010
strategy:
1111
matrix:
@@ -23,7 +23,7 @@ jobs:
2323
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
2424
GH_PAT: ${{ secrets.GH_PAT }}
2525
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
26-
GH_RELEASE_FILES: master-build.zip,master-build-firefox.zip,master-src.zip
26+
GH_RELEASE_FILES: main-build.zip,main-build-firefox.zip,main-src.zip
2727
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
2828
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2929
TRANSAK_API_KEY: ${{ secrets.TRANSAK_API_KEY }}
@@ -57,8 +57,8 @@ jobs:
5757
id: nextcloud_upload
5858
uses: trympet/nextcloud-artifacts-action@v2
5959
with:
60-
name: 'master-build.zip'
61-
path: 'master-build.zip'
60+
name: 'main-build.zip'
61+
path: 'main-build.zip'
6262
nextcloud-url: 'https://file.cdmteck.com'
6363
nextcloud-username: ${{ secrets.NEXTCLOUD_USERNAME }}
6464
nextcloud-password: ${{ secrets.NEXTCLOUD_PASSWORD }}
@@ -67,8 +67,8 @@ jobs:
6767
id: nextcloud_upload_firefox
6868
uses: trympet/nextcloud-artifacts-action@v2
6969
with:
70-
name: 'master-build-firefox.zip'
71-
path: 'master-build-firefox.zip'
70+
name: 'main-build-firefox.zip'
71+
path: 'main-build-firefox.zip'
7272
nextcloud-url: 'https://file.cdmteck.com'
7373
nextcloud-username: ${{ secrets.NEXTCLOUD_USERNAME }}
7474
nextcloud-password: ${{ secrets.NEXTCLOUD_PASSWORD }}
@@ -78,7 +78,7 @@ jobs:
7878
uses: nwtgck/actions-netlify@v2.0
7979
with:
8080
publish-dir: './packages/web-runner/build'
81-
production-branch: master
81+
production-branch: main
8282
github-token: ${{ secrets.GH_PAT }}
8383
deploy-message: ${{ github.event.head_commit.message }}
8484
enable-pull-request-comment: true
@@ -97,7 +97,7 @@ jobs:
9797
username: Extension Worker
9898
title: ${{ github.workflow }}
9999
description: |
100-
Master is completed.
100+
Main is completed.
101101
- Extension: ${{ steps.nextcloud_upload.outputs.SHAREABLE_URL }}
102102
- Extension (Firefox): ${{ steps.nextcloud_upload_firefox.outputs.SHAREABLE_URL }}
103103
- Web-runner: ${{ steps.netlify_deployment.outputs.deploy-url }}

DEPLOYMENT.md

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# BitrielWallet-Extension Deployment Guide
2+
3+
This guide explains how to deploy and publish all packages in the BitrielWallet-Extension project.
4+
5+
## Prerequisites
6+
7+
Before deploying, ensure you have:
8+
9+
1. **NPM Account**: You must be logged into npm with publishing rights
10+
```bash
11+
npm login
12+
```
13+
14+
2. **Git Configuration**: Properly configured git user (for release commits)
15+
```bash
16+
git config user.name "Your Name"
17+
git config user.email "your.email@example.com"
18+
```
19+
20+
3. **Environment Variables** (optional, for GitHub releases):
21+
- `GH_RELEASE_GITHUB_API_TOKEN` or `GITHUB_TOKEN`
22+
23+
## Deployment Commands
24+
25+
### 1. Full Deployment (Recommended)
26+
27+
Deploy everything at once - builds, tests, publishes to NPM, deploys webapp, and creates GitHub release:
28+
29+
```bash
30+
yarn deploy
31+
# or
32+
npm run deploy
33+
# or directly
34+
./scripts/koni-deploy-all.mjs
35+
```
36+
37+
**What it does:**
38+
- ✅ Checks prerequisites (npm login, git config, etc.)
39+
- 🧹 Cleans previous builds
40+
- 🔍 Runs linting
41+
- 🧪 Runs tests (continues on failure)
42+
- 🏗️ Builds all packages
43+
- 📦 Publishes all packages to NPM
44+
- 🌐 Deploys webapp to GitHub Pages
45+
- 🚀 Deploys web runner to GitHub Pages
46+
- 📋 Creates GitHub release (if configured)
47+
48+
### 2. Quick NPM-Only Deployment
49+
50+
If you just want to build and publish NPM packages (faster, no webapp deployment):
51+
52+
```bash
53+
yarn deploy:quick
54+
# or
55+
npm run deploy:quick
56+
# or directly
57+
./scripts/koni-quick-deploy.mjs
58+
```
59+
60+
**What it does:**
61+
- ✅ Checks NPM login
62+
- 🧹 Cleans previous builds
63+
- 🏗️ Builds all packages
64+
- 📦 Publishes all packages to NPM
65+
66+
### 3. Manual NPM Publishing Only
67+
68+
If packages are already built and you just want to publish them:
69+
70+
```bash
71+
./publish-npm.sh
72+
```
73+
74+
## Package Publishing Order
75+
76+
Packages are published in dependency order to ensure proper installation:
77+
78+
1. `bitriel-api-sdk`
79+
2. `extension-mocks`
80+
3. `extension-inject`
81+
4. `extension-chains`
82+
5. `extension-dapp`
83+
6. `extension-compat-metamask`
84+
7. `extension-base`
85+
8. `extension-koni`
86+
9. `extension-koni-ui`
87+
10. `extension-web-ui`
88+
11. `webapp`
89+
12. `web-runner`
90+
91+
## Individual Build Commands
92+
93+
For development and testing purposes:
94+
95+
```bash
96+
# Build everything
97+
yarn build
98+
99+
# Build with extra steps (i18n, ui)
100+
yarn build:extra
101+
102+
# Build specific components
103+
yarn build:i18n
104+
yarn build:ui
105+
yarn web-runner:build-zip
106+
yarn webapp:build
107+
108+
# Clean builds
109+
yarn clean
110+
```
111+
112+
## Troubleshooting
113+
114+
### NPM Publishing Issues
115+
116+
1. **Not logged in**: Run `npm login` first
117+
2. **Package already exists**: Version might need to be bumped
118+
3. **Permission denied**: Ensure you have publishing rights to @bitriel scope
119+
120+
### Build Issues
121+
122+
1. **Linting errors**: Run `yarn lint` to check issues
123+
2. **Type errors**: Run `yarn build` to see TypeScript errors
124+
3. **Missing dependencies**: Run `yarn install`
125+
126+
### Git Issues
127+
128+
1. **No git config**: Set up git user name and email
129+
2. **No GitHub token**: Set `GITHUB_TOKEN` environment variable for releases
130+
131+
## Version Management
132+
133+
The deployment scripts automatically handle version bumping based on the current version and build type. Beta versions (with `-` in version) are published with the `beta` tag.
134+
135+
## Deployment Summary
136+
137+
After running the full deployment, you'll see a summary showing the status of each step:
138+
139+
```
140+
🎯 DEPLOYMENT SUMMARY
141+
==================================================
142+
✅ PASSED Prerequisites
143+
✅ PASSED Clean Build
144+
✅ PASSED Linting
145+
✅ PASSED Tests
146+
✅ PASSED Build All
147+
✅ PASSED NPM Publish
148+
✅ PASSED Webapp Deploy
149+
✅ PASSED Web Runner Deploy
150+
✅ PASSED GitHub Release
151+
==================================================
152+
🎉 ALL DEPLOYMENTS COMPLETED SUCCESSFULLY!
153+
154+
📦 Your packages have been published to NPM
155+
🌐 Your webapp has been deployed to GitHub Pages
156+
🚀 Web runner has been deployed
157+
📋 GitHub release has been created (if configured)
158+
```
159+
160+
## CI/CD Integration
161+
162+
These scripts can be easily integrated into CI/CD pipelines:
163+
164+
```yaml
165+
# GitHub Actions example
166+
- name: Deploy all packages
167+
run: yarn deploy
168+
env:
169+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
170+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
171+
```

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"url": "https://github.com/bitriel/BitrielWallet-Extension.git"
1111
},
1212
"sideEffects": false,
13-
"version": "1.3.36",
13+
"version": "1.0.0",
1414
"workspaces": [
1515
"packages/*"
1616
],
@@ -21,7 +21,9 @@
2121
"koni-ci-ghact-build": "./scripts/koni-ci-ghact-build.mjs",
2222
"koni-ci-mv3-firefox": "./scripts/koni-ci-mv3-firefox.mjs",
2323
"koni-ci-webapp-update-build-number": "./scripts/koni-ci-webapp-update-build-number.mjs",
24-
"koni-dev-build-ts": "./scripts/koni-dev-build-ts.mjs"
24+
"koni-deploy-all": "./scripts/koni-deploy-all.mjs",
25+
"koni-dev-build-ts": "./scripts/koni-dev-build-ts.mjs",
26+
"koni-quick-deploy": "./scripts/koni-quick-deploy.mjs"
2527
},
2628
"scripts": {
2729
"build": "koni-dev-build-ts && yarn build:zip && yarn build:rollup",
@@ -37,6 +39,8 @@
3739
"build:zip:dst-ff": "rm -rf ./master-build-firefox.zip && cd packages/extension-koni/build-firefox && zip -r -FS ../../../master-build-firefox.zip .",
3840
"build:zip:src": "rm -rf ./master-src.zip && zip -r -x '*build/*' -x '*build-firefox/*' -x '*node_modules*' -FS ./master-src.zip packages .editorconfig .eslintignore .eslintrc.js babel.config.cjs CHANGELOG.md CONTRIBUTING.md i18next-scanner.config.js jest.config.cjs LICENSE package.json README.md tsconfig.json yarn.lock",
3941
"clean": "polkadot-dev-clean-build && rm -rf packages/extension-koni/build-firefox",
42+
"deploy": "koni-deploy-all",
43+
"deploy:quick": "koni-quick-deploy",
4044
"dev": "yarn watch-dev",
4145
"dev:firefox": "cd packages/extension-koni && yarn polkadot-exec-webpack --config webpack.config-firefox.cjs --mode development --watch -d inline-source-map",
4246
"lint": "polkadot-dev-run-lint",

packages/bitriel-api-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"./detectPackage.cjs"
1818
],
1919
"type": "module",
20-
"version": "1.0.0",
20+
"version": "1.0.1",
2121
"main": "index.js",
2222
"dependencies": {
2323
"@bitriel/chain-list": "1.0.0",

packages/extension-base/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@acala-network/api": "^5.0.2",
2424
"@apollo/client": "^3.7.14",
2525
"@azns/resolver-core": "^1.4.0",
26-
"@bitriel/bitriel-api-sdk": "^1.0.0",
26+
"@bitriel/bitriel-api-sdk": "^1.0.1",
2727
"@bitriel/chain-list": "1.0.0",
2828
"@bitriel/extension-base": "^1.0.0",
2929
"@bitriel/extension-chains": "^1.0.0",

packages/extension-base/src/core/logic-validation/request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright 2019-2022 @bitriel/extension-base
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { TypedDataV1Field, typedSignatureHash } from '@metamask/eth-sig-util';
54
import { CardanoProviderError } from '@bitriel/extension-base/background/errors/CardanoProviderError';
65
import { EvmProviderError } from '@bitriel/extension-base/background/errors/EvmProviderError';
76
import { TransactionError } from '@bitriel/extension-base/background/errors/TransactionError';
@@ -13,6 +12,7 @@ import { BasicTxErrorType, EvmFeeInfo } from '@bitriel/extension-base/types';
1312
import { BN_ZERO, combineEthFee, createPromiseHandler, isSameAddress, stripUrl, wait } from '@bitriel/extension-base/utils';
1413
import { isContractAddress, parseContractInput } from '@bitriel/extension-base/utils/eth/parseTransaction';
1514
import { getId } from '@bitriel/extension-base/utils/getId';
15+
import { TypedDataV1Field, typedSignatureHash } from '@metamask/eth-sig-util';
1616
import { isCardanoAddress, isSubstrateAddress } from '@subwallet/keyring';
1717
import { KeyringPair } from '@subwallet/keyring/types';
1818
import { keyring } from '@subwallet/ui-keyring';

packages/extension-base/src/koni/background/handlers/Extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright 2019-2022 @bitriel/extension-koni authors & contributors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { Common } from '@ethereumjs/common';
5-
import { LegacyTransaction } from '@ethereumjs/tx';
64
import { _AssetRef, _AssetType, _ChainAsset, _ChainInfo, _MultiChainAsset } from '@bitriel/chain-list/types';
75
import { TransactionError } from '@bitriel/extension-base/background/errors/TransactionError';
86
import { withErrorLog } from '@bitriel/extension-base/background/handlers/helpers';
@@ -65,6 +63,8 @@ import { _analyzeAddress, CalculateMaxTransferable, calculateMaxTransferable, co
6563
import { parseContractInput, parseEvmRlp } from '@bitriel/extension-base/utils/eth/parseTransaction';
6664
import { getId } from '@bitriel/extension-base/utils/getId';
6765
import { MetadataDef } from '@bitriel/extension-inject/types';
66+
import { Common } from '@ethereumjs/common';
67+
import { LegacyTransaction } from '@ethereumjs/tx';
6868
import { getKeypairTypeByAddress, isAddress, isCardanoAddress, isSubstrateAddress, isTonAddress } from '@subwallet/keyring';
6969
import { CardanoKeypairTypes, EthereumKeypairTypes, SubstrateKeypairTypes, TonKeypairTypes } from '@subwallet/keyring/types';
7070
import { keyring } from '@subwallet/ui-keyring';

packages/extension-base/src/koni/background/handlers/State.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2019-2022 @bitriel/extension-koni authors & contributors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import * as CardanoWasm from '@emurgo/cardano-serialization-lib-nodejs';
4+
import subwalletApiSdk from '@bitriel/bitriel-api-sdk';
55
import { _AssetRef, _AssetType, _ChainAsset, _ChainInfo, _MultiChainAsset } from '@bitriel/chain-list/types';
66
import { CardanoProviderError } from '@bitriel/extension-base/background/errors/CardanoProviderError';
77
import { EvmProviderError } from '@bitriel/extension-base/background/errors/EvmProviderError';
@@ -50,7 +50,7 @@ import { addLazy, isManifestV3, isSameAddress, reformatAddress, stripUrl, target
5050
import { convertCardanoHexToBech32 } from '@bitriel/extension-base/utils/cardano';
5151
import { createPromiseHandler } from '@bitriel/extension-base/utils/promise';
5252
import { MetadataDef, ProviderMeta } from '@bitriel/extension-inject/types';
53-
import subwalletApiSdk from '@bitriel/bitriel-api-sdk';
53+
import * as CardanoWasm from '@emurgo/cardano-serialization-lib-nodejs';
5454
import { keyring } from '@subwallet/ui-keyring';
5555
import BN from 'bn.js';
5656
import { t } from 'i18next';

packages/extension-base/src/koni/background/handlers/Tabs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import type { InjectedAccount } from '@bitriel/extension-inject/types';
55

6-
import * as CardanoWasm from '@emurgo/cardano-serialization-lib-nodejs';
76
import { _AssetType } from '@bitriel/chain-list/types';
87
import { CardanoProviderError } from '@bitriel/extension-base/background/errors/CardanoProviderError';
98
import { EvmProviderError } from '@bitriel/extension-base/background/errors/EvmProviderError';
@@ -25,6 +24,7 @@ import { AuthUrlInfo, AuthUrls } from '@bitriel/extension-base/services/request-
2524
import { DEFAULT_CHAIN_PATROL_ENABLE } from '@bitriel/extension-base/services/setting-service/constants';
2625
import { convertCardanoAddressToHex, getEVMChainInfo, reformatAddress, stripUrl } from '@bitriel/extension-base/utils';
2726
import { InjectedMetadataKnown, MetadataDef, ProviderMeta } from '@bitriel/extension-inject/types';
27+
import * as CardanoWasm from '@emurgo/cardano-serialization-lib-nodejs';
2828
import { CardanoKeypairTypes, EthereumKeypairTypes, SubstrateKeypairTypes, TonKeypairTypes } from '@subwallet/keyring/types';
2929
import { keyring } from '@subwallet/ui-keyring';
3030
import { SingleAddress, SubjectInfo } from '@subwallet/ui-keyring/observable/types';

packages/extension-base/src/page/evm/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
import type { EvmProvider } from '@bitriel/extension-inject/types';
55

6-
import SafeEventEmitter from '@metamask/safe-event-emitter';
76
import { EvmProviderError } from '@bitriel/extension-base/background/errors/EvmProviderError';
87
import { SendRequest } from '@bitriel/extension-base/page/types';
8+
import SafeEventEmitter from '@metamask/safe-event-emitter';
99
import { JsonRpcRequest, JsonRpcResponse, JsonRpcSuccess } from 'json-rpc-engine';
1010
import { RequestArguments } from 'web3-core';
1111

0 commit comments

Comments
 (0)