Skip to content

Release for Windows #224

Release for Windows

Release for Windows #224

Workflow file for this run

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