Skip to content

Commit

Permalink
win release updates
Browse files Browse the repository at this point in the history
  • Loading branch information
solarw committed Aug 30, 2024
1 parent d80ef14 commit 9f63636
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/release_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ name: Release for Windows
# git tag vX.Y.Z
# git push origin tag vX.Y.Z

on: [pull_request]
# on: [pull_request]


on:
push:
tags:
- 'v*.*.*-win'

jobs:
build-windows:
Expand Down Expand Up @@ -48,12 +54,14 @@ jobs:
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/
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
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,16 @@ endef
pwd


./dist/tendermint_win.exe: ./operate
./dist/tendermint_win.exe: ./operate/
pwd
poetry install && poetry run pyinstaller operate/services/utils/tendermint.py --onefile --name tendermint_win


./dist/pearl_win.exe: ./dist/aea_win.exe ./dist/tendermint_win.exe
./dist/pearl_win.exe: ./operate/ ./dist/aea_win.exe ./dist/tendermint_win.exe
pwd
poetry install && 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: operate
operate: ./dist/pearl_win.exe

.PHONY: build
build: ./dist/pearl_win.exe
$(call setup_env, prod)
Expand All @@ -39,7 +36,7 @@ build: ./dist/pearl_win.exe
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
NODE_ENV=${NODE_ENV} DEV_RPC=${DEV_RPC} FORK_URL=${FORK_URL} GH_TOKEN=${GH_TOKEN} node build-win.js


.PHONY: build-tenderly
Expand All @@ -49,4 +46,4 @@ build-tenderly: ./dist/pearl_win.exe
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
GH_TOKEN=${GH_TOKEN} node build-win-tenderly.js
15 changes: 13 additions & 2 deletions build-win.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ const build = require('electron-builder').build;

const { publishOptions } = require('./electron/constants');


function artifactName() {
const env = process.env.NODE_ENV;
const prefix = env === 'production' ? '' : 'dev-';
return prefix + '${productName}-${version}-${platform}-${arch}.${ext}';
}

const main = async () => {
console.log('Building...');

Expand All @@ -14,7 +21,7 @@ const main = async () => {
publish: 'onTag',
config: {
appId: 'xyz.valory.olas-operate-app',
artifactName: '${productName}-${version}-${platform}-${arch}.${ext}',
artifactName: artifactName(),
productName: 'Pearl',
files: ['electron/**/*', 'package.json'],
directories: {
Expand All @@ -23,14 +30,18 @@ const main = async () => {
nsis: {
oneClick: false,
},
win: {
publish: publishOptions,
icon: 'electron/assets/icons/splash-robot-head-dock.png',
},
extraResources: [
{
from: 'electron/bins',
to: 'bins',
filter: ['**/*'],
},
],

},
});
};
Expand Down

0 comments on commit 9f63636

Please sign in to comment.