|
| 1 | +# GitHub Workflows - Web3Telegram SDK |
| 2 | + |
| 3 | +Complete documentation of GitHub Actions workflows for the Web3Telegram SDK project. |
| 4 | + |
| 5 | +## 📋 Overview |
| 6 | + |
| 7 | +The project uses 3 categories of workflows: |
| 8 | + |
| 9 | +- **SDK** : CI, build, NPM publication of the SDK |
| 10 | +- **DApp** : CI and application deployment |
| 11 | +- **Release** : Version management and releases |
| 12 | + |
| 13 | +## 🚀 SDK Workflows |
| 14 | + |
| 15 | +### `sdk-ci.yml` |
| 16 | + |
| 17 | +**SDK CI** - Automatic validation on every PR |
| 18 | + |
| 19 | +- **Trigger** : Pull Request on `src/`, `tests/`, configs |
| 20 | +- **Actions** : Lint, unit tests, TypeScript build |
| 21 | +- **Concurrency** : Cancels previous runs |
| 22 | + |
| 23 | +### `sdk-npm-publish.yml` |
| 24 | + |
| 25 | +**Manual NPM Publication** - Deploy to NPM |
| 26 | + |
| 27 | +- **Trigger** : `workflow_dispatch` |
| 28 | +- **Inputs** : `tag` (latest/nightly) |
| 29 | +- **Restriction** : `main` branch only |
| 30 | + |
| 31 | +### `sdk-release.yml` |
| 32 | + |
| 33 | +**Automatic NPM Publication** - Official release |
| 34 | + |
| 35 | +- **Trigger** : Tag `web3telegram-v*` |
| 36 | +- **Action** : Publication with `latest` tag |
| 37 | + |
| 38 | +### `reusable-sdk-npm.yml` |
| 39 | + |
| 40 | +**Reusable Workflow** - Template for NPM publication |
| 41 | + |
| 42 | +- **Type** : `workflow_call` |
| 43 | +- **Usage** : Used by `sdk-npm-publish.yml` and `sdk-release.yml` |
| 44 | + |
| 45 | +## 🏗️ DApp Workflows |
| 46 | + |
| 47 | +### `dapp-ci.yml` |
| 48 | + |
| 49 | +**Application CI** - DApp code validation |
| 50 | + |
| 51 | +- **Trigger** : Pull Request on `dapp/` |
| 52 | +- **Actions** : Lint, tests, validation |
| 53 | + |
| 54 | +### `deployment/deployment-dapp-ci.yml` |
| 55 | + |
| 56 | +**Deployment CI** - Deployment scripts validation |
| 57 | + |
| 58 | +- **Trigger** : Pull Request on `deployment-dapp/` |
| 59 | +- **Actions** : Lint, TypeScript scripts tests |
| 60 | + |
| 61 | +## 🚀 Deployment Workflows |
| 62 | + |
| 63 | +### `deployment/dapp-deploy.yml` (Main) |
| 64 | + |
| 65 | +**Complete Deployment** |
| 66 | + |
| 67 | +- **Trigger** : `workflow_dispatch` |
| 68 | +- **Inputs** : `environment` (bellecour-dev, arbitrum-sepolia-dev, etc.) |
| 69 | +- **Process** : |
| 70 | + 1. Docker build + Sconify |
| 71 | + 2. Contract deployment |
| 72 | + 3. Push secrets |
| 73 | + 4. Publish sell order |
| 74 | + 5. Whitelist |
| 75 | + 6. ENS configuration |
| 76 | + |
| 77 | +### `deployment/01-deploy-dapp-contract.yml` |
| 78 | + |
| 79 | +**Contract Deployment** - Deploy the smart contract |
| 80 | + |
| 81 | +- **Trigger** : `workflow_dispatch` |
| 82 | +- **Inputs** : `environment`, `docker_image_tag`, `checksum`, `fingerprint` |
| 83 | +- **Outputs** : `app_address` |
| 84 | + |
| 85 | +### `deployment/02-push-dapp-secret.yml` |
| 86 | + |
| 87 | +**Push Secrets** - Push secrets to SMS (Secret Management Service) |
| 88 | + |
| 89 | +- **Trigger** : `workflow_dispatch` |
| 90 | +- **Inputs** : `environment`, `app_address` |
| 91 | + |
| 92 | +### `deployment/03-publish-sell-order.yml` |
| 93 | + |
| 94 | +**Sell Order** - Publish a free sell order |
| 95 | + |
| 96 | +- **Trigger** : `workflow_dispatch` |
| 97 | +- **Inputs** : `environment`, `app_address`, `price`, `volume` |
| 98 | + |
| 99 | +### `deployment/04-add-resource-whitelist.yml` |
| 100 | + |
| 101 | +**Whitelist** - Add app to a whitelist already deployed on whitelist-smartcontract repo and transfer ownership to web3telegram wallet |
| 102 | + |
| 103 | +- **Trigger** : `workflow_dispatch` |
| 104 | +- **Inputs** : `environment`, `app_address`, `whitelist_contract_address` |
| 105 | + |
| 106 | +### `deployment/05-configure-ens.yml` |
| 107 | + |
| 108 | +**ENS Configuration** - Configure ENS name (only on bellecour environment) |
| 109 | + |
| 110 | +- **Trigger** : `workflow_dispatch` |
| 111 | +- **Inputs** : `environment`, `app_address`, `ens_name` |
| 112 | + |
| 113 | +## 📦 Release Workflows |
| 114 | + |
| 115 | +### `release.yml` |
| 116 | + |
| 117 | +**Release Please** - Automatic version management |
| 118 | + |
| 119 | +- **Trigger** : Push on `main` |
| 120 | +- **Action** : Automatic release PR creation |
| 121 | + |
| 122 | +### `conventional-commits.yml` |
| 123 | + |
| 124 | +**Commit Validation** - Check conventional commits |
| 125 | + |
| 126 | +- **Trigger** : Pull Request |
| 127 | +- **Action** : Commit format validation |
| 128 | + |
| 129 | +## 🎯 Usage |
| 130 | + |
| 131 | +### Complete Deployment |
| 132 | + |
| 133 | +```bash |
| 134 | +gh workflow run deployment/dapp-deploy.yml -f environment=bellecour-dev |
| 135 | +``` |
| 136 | + |
| 137 | +### SDK Publication |
| 138 | + |
| 139 | +```bash |
| 140 | +# Manual publication |
| 141 | +gh workflow run sdk-npm-publish.yml -f tag=nightly |
| 142 | + |
| 143 | +# Automatic publication (via tag) |
| 144 | +git tag web3telegram-v1.0.0 |
| 145 | +git push origin web3telegram-v1.0.0 |
| 146 | +``` |
| 147 | + |
| 148 | +## 🔧 Environments |
| 149 | + |
| 150 | +| Environment | Network | Usage | |
| 151 | +| ----------------------- | ----------------- | --------------- | |
| 152 | +| `bellecour-dev` | Bellecour Testnet | Development | |
| 153 | +| `arbitrum-sepolia-dev` | Arbitrum Sepolia | Testing | |
| 154 | +| `bellecour-prod` | Bellecour Mainnet | Production | |
| 155 | +| `arbitrum-sepolia-prod` | Arbitrum Sepolia | Production test | |
| 156 | +| `arbitrum-prod` | Arbitrum Mainnet | Production | |
| 157 | + |
| 158 | +## 📁 Structure |
| 159 | + |
| 160 | +``` |
| 161 | +.github/workflows/ |
| 162 | +├── sdk-ci.yml # SDK CI |
| 163 | +├── sdk-npm-publish.yml # Manual NPM publication |
| 164 | +├── sdk-release.yml # Automatic NPM publication |
| 165 | +├── reusable-sdk-npm.yml # NPM template |
| 166 | +├── dapp-ci.yml # DApp CI |
| 167 | +├── release.yml # Release Please |
| 168 | +├── conventional-commits.yml # Commit validation |
| 169 | +└── deployment/ # Deployment workflows |
| 170 | + ├── dapp-deploy.yml # Main orchestrator |
| 171 | + ├── 01-deploy-dapp-contract.yml |
| 172 | + ├── 02-push-dapp-secret.yml |
| 173 | + ├── 03-publish-sell-order.yml |
| 174 | + ├── 04-add-resource-whitelist.yml |
| 175 | + ├── 05-configure-ens.yml |
| 176 | + └── deployment-dapp-ci.yml # Deployment CI |
| 177 | +``` |
| 178 | + |
| 179 | +## ⚡ Benefits |
| 180 | + |
| 181 | +- **Modularity** : Each step can be executed independently |
| 182 | +- **Recovery** : In case of failure, restart only the concerned step |
| 183 | +- **Flexibility** : Reusable and configurable workflows |
| 184 | +- **Security** : Automatic validation and separate environments |
| 185 | +- **Traceability** : Detailed logs for each step |
0 commit comments