-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
230 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Release | ||
|
||
# This workflow is triggered on pushing a tag BE CAREFUL this application AUTO UPDATES !!! | ||
# git tag vX.Y.Z | ||
# git push origin tag vX.Y.Z | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
build-windows: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
arch: [ x64, arm64 ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
|
||
- uses: msys2/setup-msys2@v2 | ||
with: | ||
update: true | ||
install: >- | ||
curl | ||
git | ||
make | ||
- 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 | ||
|
||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- name: install node deps | ||
shell: msys2 {0} | ||
run: yarn install-deps | ||
|
||
- name: set env vars to prod.env | ||
shell: msys2 {0} | ||
env: | ||
NODE_ENV: production | ||
DEV_RPC: https://rpc-gate.autonolas.tech/gnosis-rpc/ | ||
IS_STAGING: ${{ github.ref != 'refs/heads/main' && 'true' || 'false' }} | ||
FORK_URL: https://rpc-gate.autonolas.tech/gnosis-rpc/ | ||
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 | ||
- run: rm -rf /dist | ||
shell: msys2 {0} | ||
- name: "Build, notarize, publish" | ||
shell: msys2 {0} | ||
run: make build |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
define setup_env | ||
$(eval ENV_FILE := $(1).env) | ||
@echo " - setup env $(ENV_FILE)" | ||
$(eval include $(1).env) | ||
$(eval export) | ||
endef | ||
|
||
|
||
./trader/: | ||
git clone https://github.com/valory-xyz/trader.git | ||
|
||
./dist/aea_win.exe: ./trader/ | ||
mkdir -p dist | ||
cd trader && poetry install && 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 --hidden-import grpc --hidden-import openapi_core --collect-all google.protobuf --collect-all openapi_core --collect-all openapi_spec_validator --collect-all asn1crypto --hidden-import py_ecc --hidden-import pytz --onefile pyinstaller/trader_bin.py --name trader_win | ||
cp -f trader/dist/trader_win.exe ./dist/aea_win.exe | ||
|
||
|
||
./dist/tendermint_win.exe: ./operate | ||
poetry run pyinstaller operate/services/utils/tendermint.py --onefile --name tendermint_win | ||
|
||
|
||
./dist/pearl_win.exe: ./dist/aea_win.exe ./dist/tendermint_win.exe | ||
poetry run pyinstaller --collect-data eth_account --collect-all aea --collect-all coincurve --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_win.exe:. --add-binary dist/tendermint_win.exe:. --onefile --name pearl_win | ||
|
||
|
||
.PHONY: build | ||
build: ./dist/pearl_win.exe | ||
$(call setup_env, prod) | ||
echo ${DEV_RPC} | ||
cp -f dist/pearl_win.exe ./electron/bins/pearl_win.exe | ||
echo ${NODE_ENV} | ||
NODE_ENV=${NODE_ENV} DEV_RPC=${DEV_RPC} FORK_URL=${FORK_URL} yarn build:frontend | ||
node build-win.js | ||
|
||
|
||
.PHONY: build-tenderly | ||
build-tenderly: ./dist/pearl_win.exe | ||
$(call setup_env, dev-tenderly) | ||
echo ${DEV_RPC} | ||
cp -f dist/pearl_win.exe ./electron/bins/pearl_win.exe | ||
echo ${NODE_ENV} | ||
NODE_ENV=${NODE_ENV} DEV_RPC=${DEV_RPC} FORK_URL=${FORK_URL} yarn build:frontend | ||
node build-win-tenderly.js |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* This script is used to build the electron app **with notarization**. It is used for the final build and release process. | ||
*/ | ||
require('dotenv').config(); | ||
const build = require('electron-builder').build; | ||
|
||
const { publishOptions } = require('./electron/constants'); | ||
|
||
const main = async () => { | ||
console.log('Building...'); | ||
|
||
/** @type import {CliOptions} from "electron-builder" */ | ||
await build({ | ||
publish: 'onTag', | ||
config: { | ||
appId: 'xyz.valory.olas-operate-app', | ||
artifactName: '${productName}-${version}-${platform}-${arch}-tenderly.${ext}', | ||
productName: 'Pearl', | ||
files: ['electron/**/*', 'package.json'], | ||
directories: { | ||
output: 'dist', | ||
}, | ||
nsis: { | ||
oneClick: false, | ||
}, | ||
extraResources: [ | ||
{ | ||
from: 'electron/bins', | ||
to: 'bins', | ||
filter: ['**/*'], | ||
}, | ||
], | ||
|
||
}, | ||
}); | ||
}; | ||
|
||
main().then((response) => { console.log('Build & Notarize complete'); }).catch((e) => console.error(e)); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* This script is used to build the electron app **with notarization**. It is used for the final build and release process. | ||
*/ | ||
require('dotenv').config(); | ||
const build = require('electron-builder').build; | ||
|
||
const { publishOptions } = require('./electron/constants'); | ||
|
||
const main = async () => { | ||
console.log('Building...'); | ||
|
||
/** @type import {CliOptions} from "electron-builder" */ | ||
await build({ | ||
publish: 'onTag', | ||
config: { | ||
appId: 'xyz.valory.olas-operate-app', | ||
artifactName: '${productName}-${version}-${platform}-${arch}.${ext}', | ||
productName: 'Pearl', | ||
files: ['electron/**/*', 'package.json'], | ||
directories: { | ||
output: 'dist', | ||
}, | ||
nsis: { | ||
oneClick: false, | ||
}, | ||
extraResources: [ | ||
{ | ||
from: 'electron/bins', | ||
to: 'bins', | ||
filter: ['**/*'], | ||
}, | ||
], | ||
|
||
}, | ||
}); | ||
}; | ||
|
||
main().then((response) => { console.log('Build & Notarize complete'); }).catch((e) => console.error(e)); |
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
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
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