Skip to content

Commit

Permalink
chore: conflict fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mohandast52 committed Dec 19, 2024
2 parents 4b885d6 + 817e045 commit dacfc68
Show file tree
Hide file tree
Showing 148 changed files with 5,384 additions and 1,659 deletions.
120 changes: 95 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14]
arch: [arm64, x64]
os: [macos-14, macos-14-large]

steps:
- uses: actions/checkout@v3
Expand All @@ -36,8 +35,12 @@ jobs:

# Set OS_ARCH env
- name: Set architecture environment variable
run:
echo "OS_ARCH=${{ matrix.arch }}" >> $GITHUB_ENV;
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
Expand All @@ -47,9 +50,9 @@ jobs:
~/.cache/pypoetry
~/.cache/pip
~/.venv
key: poetry-${{ matrix.arch }}-${{ hashFiles('**/poetry.lock') }}
key: poetry-${{ env.OS_ARCH }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ matrix.arch }}-
poetry-${{ env.OS_ARCH }}-
- name: Install dependencies
run: poetry install
Expand All @@ -69,27 +72,40 @@ jobs:
- 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 --add-binary dist/aea_bin:. --add-binary dist/tendermint:. --onefile --name pearl_${{ env.OS_ARCH }}
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_${{ matrix.arch }}
path: dist/pearl_${{ matrix.arch }}
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: macos-14
runs-on: ${{ matrix.os }}
strategy:
matrix:
env: [production, development]
arch: [arm64, x64]
os: [macos-14, macos-14-large]

needs: build-macos-pyinstaller

Expand All @@ -108,25 +124,63 @@ jobs:
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_${{ matrix.arch }}
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/pearl_${{ matrix.arch }}
run: chmod +x electron/bins/*

# 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') }}
key: electron-node-modules-${{ runner.os }}-${{ env.OS_ARCH }}-${{ matrix.env }}-${{ hashFiles('yarn.lock') }}

# Install electron dependencies if cache miss
- name: Install electron dependencies
Expand All @@ -139,7 +193,7 @@ jobs:
uses: actions/cache@v3
with:
path: frontend/node_modules
key: frontend-node-modules-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.env }}-${{ hashFiles('frontend/yarn.lock') }}
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
Expand All @@ -157,6 +211,7 @@ jobs:
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
Expand All @@ -167,9 +222,10 @@ jobs:
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/
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)
Expand All @@ -182,12 +238,19 @@ jobs:
CSC_LINK: ${{ secrets.CSC_LINK }}
GH_TOKEN: ${{ secrets.github_token }}
NODE_ENV: ${{ matrix.env }}
ARCH: ${{ matrix.arch }}
ARCH: ${{ env.OS_ARCH }}
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/
run: node build.js
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)
Expand All @@ -200,9 +263,16 @@ jobs:
CSC_LINK: ${{ secrets.CSC_LINK }}
GH_TOKEN: ${{ secrets.github_token }}
NODE_ENV: ${{ matrix.env }}
ARCH: ${{ matrix.arch }}
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/
ARCH: ${{ env.OS_ARCH }}
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/
run: node build.js
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
39 changes: 36 additions & 3 deletions .github/workflows/release_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ jobs:
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://rpc-gate.autonolas.tech/base-rpc/"
GNOSIS_RPC: "https://virtual.gnosis.rpc.tenderly.co/80ff70d1-71fd-4c9e-9402-913f0c4c58b0"
ETHEREUM_RPC: "https://rpc-gate.autonolas.tech/ethereum-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:
Expand Down Expand Up @@ -100,13 +102,43 @@ jobs:
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: |
Expand All @@ -116,6 +148,7 @@ jobs:
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
Expand Down
Loading

0 comments on commit dacfc68

Please sign in to comment.