-
Notifications
You must be signed in to change notification settings - Fork 2
113 lines (97 loc) · 3.97 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
name: Release for Windows
on:
push:
tags:
- "v*.*.*"
jobs:
build-windows:
runs-on: windows-latest
strategy:
matrix:
include:
- env: "production"
rpc: "https://rpc-gate.autonolas.tech/gnosis-rpc/"
arch: "x64"
- env: "development"
rpc: "https://virtual.gnosis.rpc.tenderly.co/80ff70d1-71fd-4c9e-9402-913f0c4c58b0"
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: set env vars to prod.env
env:
NODE_ENV: ${{ matrix.env }}
DEV_RPC: ${{ matrix.rpc }}
IS_STAGING: ${{ github.ref != 'refs/heads/main' && 'true' || 'false' }}
FORK_URL: ${{ matrix.rpc }}
GH_TOKEN: ${{ secrets.github_token}}
run: |
echo NODE_ENV=$NODE_ENV >> prod.env
echo DEV_RPC=$DEV_RPC >> prod.env
echo IS_STAGING=$IS_STAGING >> prod.env
echo FORK_URL=$FORK_URL >> prod.env
cat prod.env
echo GH_TOKEN=$GH_TOKEN >> prod.env
- run: rm -rf /dist
- name: "Build, notarize, publish"
run: make build