-
Notifications
You must be signed in to change notification settings - Fork 274
135 lines (117 loc) · 4.38 KB
/
release.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
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
131
132
133
134
135
name: Release
on:
push:
branches:
- release/*
tags:
- "**"
env:
PNPM_VERSION: 9
NODE_VERSION: 18.x
jobs:
build:
strategy:
matrix:
env: [prod, staging, hydrogen]
environment: ${{ matrix.env }}
env:
FEATURE_PRIVACY_SETTINGS: "true"
FEATURE_EXPERIMENTAL_SETTINGS: "false"
FEATURE_BETA_FEATURES: "false"
FEATURE_BANXA: "true"
FEATURE_LAYERSWAP: "true"
FEATURE_ORBITER: "true"
ENABLE_TOKEN_DETAILS: "true"
FEATURE_DEFI_DECOMPOSITION: "true"
FEATURE_MULTISIG: "true"
SENTRY_ENVIRONMENT: ${{ vars.SENTRY_ENVIRONMENT }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
RAMP_API_KEY: ${{ secrets.RAMP_API_KEY }}
TOPPER_PEM_KEY: ${{ secrets.TOPPER_PEM_KEY }}
FILENAME: argent-extension
SAFE_ENV_VARS: true
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }}
ARGENT_X_NEWS_URL: ${{ vars.ARGENT_X_NEWS_URL }}
ARGENT_X_ENVIRONMENT: ${{ matrix.env }}
MULTICALL_MAX_BATCH_SIZE: 20
# Refresh intervals
REFRESH_INTERVAL_FAST: 20
REFRESH_INTERVAL_MEDIUM: 60
REFRESH_INTERVAL_SLOW: 300
REFRESH_INTERVAL_VERY_SLOW: 86400
MIN_LEDGER_APP_VERSION: 2.2.1
NEW_CAIRO_0_ENABLED: false
if: ${{ !startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/tags/') && contains(github.ref, 'extension') }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
- name: Set Sentry Release name
run: |
PACKAGE_VERSION=$(cat ./packages/extension/package.json | jq -r '.version')
echo "SENTRY_RELEASE=${PACKAGE_VERSION}" >> $GITHUB_ENV
- name: Setup project
run: pnpm run setup
- name: Build Chrome version
run: pnpm build
- name: Check bundle size for chrome
run: pnpm check-bundle-size
- name: Set filename prefix
run: |
if [ "${{ matrix.env }}" = "prod" ]; then
echo "FILENAME_PREFIX=$(echo ${{ env.FILENAME }} | tr / -)" >> $GITHUB_ENV
else
echo "FILENAME_PREFIX=$(echo ${{ env.FILENAME }}-${{ matrix.env }} | tr / -)" >> $GITHUB_ENV
fi
- name: Create chrome zip
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-chrome.zip" . -x "*.map") # -x "*.map" exludes source maps needed for Sentry
- name: Build Firefox version
run: MANIFEST_VERSION=v2 pnpm --filter @argent-x/extension build
- name: Create firefox zip
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-firefox.zip" . -x "*.map") # -x "*.map" exludes source maps needed for Sentry
- name: Check bundle size for firefox
run: pnpm check-bundle-size
- name: Upload artifacts for chrome
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.env == 'prod' && 'chrome' || format('{0}-chrome', env.FILENAME_PREFIX) }}
path: "*-chrome.zip"
retention-days: 14
if-no-files-found: error
- name: Upload artifacts for firefox
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.env == 'prod' && 'firefox' || format('{0}-firefox', env.FILENAME_PREFIX) }}
path: "*-firefox.zip"
retention-days: 14
if-no-files-found: error
- name: Get Extension version
id: package-version
run: |
PACKAGE_VERSION=$(cat ./packages/extension/package.json | jq -r '.version')
echo "current-version=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
name: extension@${{ steps.package-version.outputs.current-version }}
files: |
*.zip