-
Notifications
You must be signed in to change notification settings - Fork 2
156 lines (137 loc) · 6.38 KB
/
release_win.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Release for Windows
on:
push:
tags:
- "v*.*.*"
jobs:
build-windows:
runs-on: windows-latest
strategy:
matrix:
include:
- env: "production"
OPTIMISM_RPC: "https://rpc-gate.autonolas.tech/optimism-rpc/"
BASE_RPC: "https://rpc-gate.autonolas.tech/base-rpc/"
GNOSIS_RPC: "https://rpc-gate.autonolas.tech/gnosis-rpc/"
ETHEREUM_RPC: "https://rpc-gate.autonolas.tech/ethereum-rpc/"
MODE_RPC: "https://mainnet.mode.network"
arch: "x64"
- env: "development"
OPTIMISM_RPC: "https://rpc-gate.autonolas.tech/optimism-rpc/"
BASE_RPC: "https://virtual.base.rpc.tenderly.co/2a91611a-3251-48a6-8095-b86815de84bf"
GNOSIS_RPC: "https://virtual.gnosis.rpc.tenderly.co/7de511da-9ad7-4e9f-98c1-e99052e92b15"
ETHEREUM_RPC: "https://rpc-gate.autonolas.tech/ethereum-rpc/"
MODE_RPC: "https://mainnet.mode.network"
arch: "x64"
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
# Set up Python with setup-python action and add it to PATH
- uses: actions/setup-python@v5
id: setup-python
with:
python-version: "3.10"
- name: Add Python to PATH
run: |
echo "${{ steps.setup-python.outputs.python-path }}" >> $GITHUB_PATH
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
# Configure Yarn network settings for timeout, retries, and reduced concurrency
- name: Configure Yarn network settings
run: |
yarn config set network-timeout 60000 # Set network timeout to 1 minute
yarn config set network-retries 10 # Retry up to 10 times
yarn config set network-concurrency 2 # Reduce concurrency to 2 connections
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: "1.8.3"
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-path: ~/my-custom-path
installer-parallel: true
# INSTALL PROJECT DEPENDENCIES
- name: Restore middleware venv cache
id: cache-middleware-venv
uses: actions/cache@v3
with:
path: ~/my-custom-path
key: middleware-venv-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.env }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install Poetry dependencies (if venv cache miss)
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: yarn install:backend
# Cache electron node_modules with unique key for each environment and architecture
- name: Restore electron node_modules cache
id: cache-electron-node-modules
uses: actions/cache@v3
with:
path: node_modules
key: electron-node-modules-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.env }}-${{ hashFiles('yarn.lock') }}
# Install electron dependencies if cache miss
- name: Install electron dependencies
if: steps.cache-electron-node-modules.outputs.cache-hit != 'true'
run: yarn install
# Cache frontend node_modules with unique key for each environment and architecture
- name: Restore frontend node_modules cache
id: cache-frontend-node-modules
uses: actions/cache@v3
with:
path: frontend/node_modules
key: frontend-node-modules-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.env }}-${{ hashFiles('frontend/yarn.lock') }}
# Install frontend dependencies if cache miss
- name: Install frontend dependencies
if: steps.cache-frontend-node-modules.outputs.cache-hit != 'true'
run: yarn install:frontend
- name: Setup Certificate
run: |
echo "${{secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
shell: bash
- name: Set variables
id: variables
run: |
echo "::set-output name=version::${GITHUB_REF#refs/tags/v}"
echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV"
echo "SM_API_KEY=${{ secrets.SM_API_KEY }}" >> "$GITHUB_ENV"
echo "SM_KEY_PAIR_ALIAS=${{ secrets.SM_KEY_PAIR_ALIAS }}" >> "$GITHUB_ENV"
echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV"
echo "SM_CLIENT_CERT_PASSWORD=${{ secrets.SM_CLIENT_CERT_PASSWORD }}" >> "$GITHUB_ENV"
echo "C:\Program Files (x86)\Windows Kits\10\App Certification Kit" >> $GITHUB_PATH
echo "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools" >> $GITHUB_PATH
echo "C:\Program Files\DigiCert\DigiCert One Signing Manager Tools" >> $GITHUB_PATH
shell: bash
- name: Setup SSM KSP on windows latest
run: |
curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/smtools-windows-x64.msi/download -H "x-api-key:%SM_API_KEY%" -o smtools-windows-x64.msi
msiexec /i smtools-windows-x64.msi /quiet /qn
smksp_registrar.exe list
smctl.exe keypair ls
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
smksp_cert_sync.exe
shell: cmd
- name: set env vars to prod.env
env:
NODE_ENV: ${{ matrix.env }}
GNOSIS_RPC: ${{ matrix.GNOSIS_RPC }}
BASE_RPC: ${{ matrix.BASE_RPC }}
ETHEREUM_RPC: ${{ matrix.ETHEREUM_RPC }}
OPTIMISM_RPC: ${{ matrix.OPTIMISM_RPC }}
MODE_RPC: ${{ matrix.MODE_RPC }}
IS_STAGING: ${{ github.ref != 'refs/heads/main' && 'true' || 'false' }}
GH_TOKEN: ${{ secrets.github_token}}
run: |
echo NODE_ENV=$NODE_ENV >> prod.env
echo IS_STAGING=$IS_STAGING >> prod.env
echo OPTIMISM_RPC=$OPTIMISM_RPC >> prod.env
echo BASE_RPC=$BASE_RPC >> prod.env
echo ETHEREUM_RPC=$ETHEREUM_RPC >> prod.env
echo GNOSIS_RPC=$GNOSIS_RPC >> prod.env
echo MODE_RPC=$MODE_RPC >> prod.env
cat prod.env
echo GH_TOKEN=$GH_TOKEN >> prod.env
- run: rm -rf /dist
- name: "Build, notarize, publish"
run: make build