Merge pull request #624 from valory-xyz/chore/update_agent_3 #334
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |