feat: implement unsaved changes warning on back button click in Updat… #548
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 | |
# Triggered on pushing a tag | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
# PyInstaller job for both x64 and arm64 binaries | |
build-macos-pyinstaller: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-14, macos-14-large] | |
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" | |
# Install Poetry and its dependencies | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: "1.4.0" | |
virtualenvs-create: true | |
virtualenvs-in-project: false | |
virtualenvs-path: ~/my-custom-path | |
installer-parallel: true | |
# Set OS_ARCH env | |
- name: Set architecture environment variable | |
run: | | |
if [ "${{ matrix.os }}" == "macos-14-large" ]; then | |
echo "OS_ARCH=x64" >> $GITHUB_ENV; | |
else | |
echo "OS_ARCH=arm64" >> $GITHUB_ENV; | |
fi | |
# Cache Poetry dependencies with unique key for each environment and architecture | |
- name: Cache Poetry dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pypoetry | |
~/.cache/pip | |
~/.venv | |
key: poetry-${{ env.OS_ARCH }}-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
poetry-${{ env.OS_ARCH }}- | |
- name: Install dependencies | |
run: poetry install | |
# Download and build with PyInstaller | |
- name: Get trader bin | |
run: | | |
trader_version=$(poetry run python -c "import yaml; config = yaml.safe_load(open('templates/trader.yaml')); print(config['service_version'])") | |
echo $trader_version | |
make ./dist/aea_bin | |
#instead of this one mwe use make; mkdir dist && curl -L -o dist/aea_bin "https://github.com/valory-xyz/trader/releases/download/${trader_version}/trader_bin_${{ env.OS_ARCH }}" | |
# -- old optimus getter | |
# optimus_version=$(poetry run python -c "import yaml; config = yaml.safe_load(open('templates/optimus.yaml')); print(config['service_version'])") | |
# echo $optimus_version | |
# mkdir dist && curl -L -o dist/aea_bin "https://github.com/valory-xyz/optimus/releases/download/${$optimus_version}/optimus_bin_${{ env.OS_ARCH }}" | |
- name: Build with PyInstaller | |
run: | | |
poetry run pyinstaller operate/services/utils/tendermint.py --onefile | |
cp dist/tendermint dist/tendermint_bin | |
# patch open aea in place | |
rm -fr ./open-aea | |
git clone https://github.com/valory-xyz/open-aea.git -b fix/1.5.2_encoding | |
poetry run pip install ./open-aea/ | |
poetry run pyinstaller --collect-data eth_account --collect-all aea --collect-all autonomy --collect-all operate --collect-all aea_ledger_ethereum --collect-all aea_ledger_cosmos --collect-all aea_ledger_ethereum_flashbots --hidden-import aea_ledger_ethereum --hidden-import aea_ledger_cosmos --hidden-import aea_ledger_ethereum_flashbots operate/pearl.py --onefile --name pearl_${{ env.OS_ARCH }} | |
- name: Upload Release Assets | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pearl_${{ env.OS_ARCH }} | |
path: dist/pearl_${{ env.OS_ARCH }} | |
- name: Upload Tendermint | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tendermint_${{ env.OS_ARCH }} | |
path: dist/tendermint_bin | |
- name: Upload aea | |
uses: actions/upload-artifact@v4 | |
with: | |
name: aea_bin_${{ env.OS_ARCH }} | |
path: ./dist/aea_bin | |
# Jobs for production and development, running separately for x64 and arm64 | |
build-release: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
env: [production, development] | |
os: [macos-14, macos-14-large] | |
needs: build-macos-pyinstaller | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 | |
# Set OS_ARCH env | |
- name: Set architecture environment variable | |
run: | | |
if [ "${{ matrix.os }}" == "macos-14-large" ]; then | |
echo "OS_ARCH=x64" >> $GITHUB_ENV; | |
else | |
echo "OS_ARCH=arm64" >> $GITHUB_ENV; | |
fi | |
# Download the appropriate architecture artifact | |
- name: Download Pearl binary for architecture | |
uses: actions/download-artifact@v4 | |
with: | |
name: pearl_${{ env.OS_ARCH }} | |
path: electron/bins/ | |
- name: Download aea binary for architecture | |
uses: actions/download-artifact@v4 | |
with: | |
name: aea_bin_${{ env.OS_ARCH }} | |
path: electron/bins/ | |
- name: Download tendermint binary for architecture | |
uses: actions/download-artifact@v4 | |
with: | |
name: tendermint_${{ env.OS_ARCH }} | |
path: electron/bins/ | |
# Configure Yarn network settings for timeout, retries, and reduced concurrency | |
- name: Configure Yarn network settings | |
run: | | |
ls electron/bins/ | |
# download TM | |
- name: Set architecture environment variable | |
run: | | |
if [ "${{ matrix.os }}" == "macos-14-large" ]; then | |
export TM_DOWNLOAD_URL=https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_darwin_amd64.tar.gz | |
else | |
export TM_DOWNLOAD_URL=https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_darwin_arm64.tar.gz | |
fi | |
curl $TM_DOWNLOAD_URL -L -o tendermint.tar.gz | |
tar -xvf tendermint.tar.gz | |
cp ./tendermint electron/bins/tendermint | |
chmod +x electron/bins/tendermint | |
# Add execution permissions to the binaries | |
- name: Add exec permissions | |
run: chmod +x electron/bins/* | |
# Cache electron-builder downloads | |
- name: Restore electron-builder cache | |
id: cache-electron-builder | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/electron-builder | |
key: electron-builder-cache-${{ runner.os }}-${{ env.OS_ARCH }}-${{ matrix.env }}-${{ hashFiles('yarn.lock') }} | |
# 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 }}-${{ env.OS_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 }}-${{ env.OS_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 | |
# Build frontend for production | |
- name: Build frontend for production | |
if: matrix.env == 'production' | |
run: yarn build:frontend | |
env: | |
NODE_ENV: ${{ matrix.env }} | |
IS_STAGING: ${{ github.ref != 'refs/heads/main' && 'true' || 'false' }} | |
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 | |
# Build frontend for development | |
- name: Build frontend for development | |
if: matrix.env == 'development' | |
run: yarn build:frontend | |
env: | |
NODE_ENV: ${{ matrix.env }} | |
IS_STAGING: ${{ github.ref != 'refs/heads/main' && 'true' || 'false' }} | |
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 | |
# Run the build and notarization process for production | |
- name: Build, notarize, and publish (Production) | |
if: matrix.env == 'production' | |
env: | |
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLEIDPASS }} | |
APPLE_ID: ${{ secrets.APPLEID }} | |
APPLE_TEAM_ID: ${{ secrets.APPLETEAMID }} | |
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | |
CSC_LINK: ${{ secrets.CSC_LINK }} | |
GH_TOKEN: ${{ secrets.github_token }} | |
NODE_ENV: ${{ matrix.env }} | |
ARCH: ${{ env.OS_ARCH }} | |
ELECTRON_BUILDER_CACHE: ~/.cache/electron-builder | |
ELECTRON_BUILDER_DOWNLOAD_RETRY: 10 | |
ELECTRON_BUILDER_DOWNLOAD_TIMEOUT: 120000 | |
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 | |
run: | | |
echo "OPTIMISM_RPC=https://rpc-gate.autonolas.tech/optimism-rpc/" >> .env | |
echo "BASE_RPC=https://rpc-gate.autonolas.tech/base-rpc/" >> .env | |
echo "GNOSIS_RPC=https://rpc-gate.autonolas.tech/gnosis-rpc/" >> .env | |
echo "ETHEREUM_RPC=https://rpc-gate.autonolas.tech/ethereum-rpc/" >> .env | |
echo "MODE_RPC=https://mainnet.mode.network" >> .env | |
node build.js | |
# Run the build and notarization process for development | |
- name: Build, notarize, and publish (Development) | |
if: matrix.env == 'development' | |
env: | |
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLEIDPASS }} | |
APPLE_ID: ${{ secrets.APPLEID }} | |
APPLE_TEAM_ID: ${{ secrets.APPLETEAMID }} | |
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | |
CSC_LINK: ${{ secrets.CSC_LINK }} | |
GH_TOKEN: ${{ secrets.github_token }} | |
NODE_ENV: ${{ matrix.env }} | |
ARCH: ${{ env.OS_ARCH }} | |
ELECTRON_BUILDER_CACHE: ~/.cache/electron-builder | |
ELECTRON_BUILDER_DOWNLOAD_RETRY: 10 | |
ELECTRON_BUILDER_DOWNLOAD_TIMEOUT: 120000 | |
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 | |
run: | | |
echo "OPTIMISM_RPC=https://rpc-gate.autonolas.tech/optimism-rpc/" >> .env | |
echo "BASE_RPC=https://virtual.base.rpc.tenderly.co/2a91611a-3251-48a6-8095-b86815de84bf" >> .env | |
echo "GNOSIS_RPC=https://virtual.gnosis.rpc.tenderly.co/7de511da-9ad7-4e9f-98c1-e99052e92b15" >> .env | |
echo "ETHEREUM_RPC=https://rpc-gate.autonolas.tech/ethereum-rpc/" >> .env | |
echo "MODE_RPC=https://mainnet.mode.network" >> .env | |
node build.js |