-
Notifications
You must be signed in to change notification settings - Fork 88
130 lines (110 loc) · 3.91 KB
/
cd.yaml
File metadata and controls
130 lines (110 loc) · 3.91 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Release
on:
push:
branches:
- main
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
permissions:
id-token: write # Required for OIDC
contents: write # to be able to publish a GitHub release
env:
VITE_ENV: "ci"
HOSTNAME: "app-ipfs.venus.io"
CLI_NODE_REAL_API_KEY: ${{ secrets.CLI_NODE_REAL_API_KEY }}
CLI_ALCHEMY_API_KEY: ${{ secrets.CLI_ALCHEMY_API_KEY }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
registry-url: 'https://registry.npmjs.org'
cache: "yarn"
- name: Install dependencies
run: |
yarn install --immutable
# Install required npm version to use trusted publisher
# (https://docs.npmjs.com/trusted-publishers)
npm install -g npm@11.5.1
- name: Run tests and collect coverage
run: yarn test --coverage
# Bump package versions based on changesets and commit changes to the main branch
- name: Publish
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
BLOB_READ_WRITE_TOKEN: ${{ secrets.VERCEL_BLOB_TOKEN }}
IMG_CDN_URL: ${{ vars.IMG_CDN_URL }}
run: |
git config user.name toolsvenus
git config user.email tools@venus.io
git fetch origin
git rebase --strategy-option=theirs origin/main
npx changeset version
if git diff -- "packages/chains/package.json" | grep -qE '^\+ *"version":'; then
yarn workspace @venusprotocol/chains deploy-images
yarn workspace @venusprotocol/chains build
fi
npx changeset publish
git add -A
git status
git commit --verbose -a -m "chore: bump package versions" || exit 0
git push
- name: Build
env:
VITE_NETWORK: "mainnet"
VITE_ENV: "production"
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
VITE_POSTHOG_API_KEY: ${{ secrets.VITE_POSTHOG_API_KEY }}
VITE_POSTHOG_HOST_URL: ${{ secrets.VITE_POSTHOG_HOST_URL }}
VITE_ZYFI_API_KEY: ${{ secrets.VITE_ZYFI_API_KEY }}
VITE_ALCHEMY_API_KEY: ${{ secrets.VITE_ALCHEMY_API_KEY }}
VITE_NODE_REAL_API_KEY: ${{ secrets.VITE_NODE_REAL_API_KEY }}
VITE_THE_GRAPH_API_KEY: ${{ secrets.VITE_THE_GRAPH_API_KEY }}
run: |
# We only build the dApp because it's the only app deployed to IPFS
yarn build --filter=@venusprotocol/evm
- name: Upload to IPFS and pin
id: uploadBuildToIpfs
uses: VenusProtocol/pinata-action@96e90c7a6eb52b60267a323758d89d25bf5e1d72
with:
path: ./apps/evm/build
pinName: ${{ env.HOSTNAME }}
maxPinsToKeep: 20
pinataApiKey: ${{ secrets.PINATA_API_KEY }}
pinataApiSecret: ${{ secrets.PINATA_API_SECRET }}
- name: Update DNS record and purge cache
uses: VenusProtocol/cloudflare-dnslink-action@297058f76eaeb59a95bc6352e7535f49a56ff456
with:
cid: ${{ steps.uploadBuildToIpfs.outputs.cid }}
purge: true
cloudflareHostname: ${{ env.HOSTNAME }}
cloudflareApiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
cloudflareZoneId: ${{ secrets.CLOUDFLARE_ZONE_ID }}
- name: Warm up cache
uses: VenusProtocol/globalping-action@f38ac8fef000087c08282a4437b54e398bd6f42a
with:
target: ${{ env.HOSTNAME }}
countryCodes: |
SG
HK
JP
DE
US
BR
GB
FR
SE
AU
IN
IE