-
Notifications
You must be signed in to change notification settings - Fork 19
215 lines (208 loc) · 8.29 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: Release Flow
on:
push:
tags:
- 'test-v*.*.*'
jobs:
# publish-packages:
# name: Push Packages
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# os: [ubuntu-latest]
# python-version: ["3.10"]
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-versions }}
# - uses: addnab/docker-run-action@v3
# with:
# image: valory/open-autonomy-user:latest
# options: -v ${{ github.workspace }}:/work
# run: |
# echo "Pushing Packages"
# cd /work
# export AUTHOR=$(grep 'service' packages/packages.json | awk -F/ '{print $2}' | head -1)
# autonomy init --reset --author $AUTHOR --ipfs --remote
# autonomy push-all
# publish-images:
# name: Publish Docker Images
# runs-on: ${{ matrix.os }}
# needs:
# - "publish-packages"
# strategy:
# matrix:
# os: [ubuntu-latest]
# python-version: ["3.10"]
# env:
# DOCKER_USER: ${{secrets.DOCKER_USER}}
# DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Set up tag and vars
# uses: addnab/docker-run-action@v3
# with:
# image: valory/open-autonomy-user:latest
# options: -v ${{ github.workspace }}:/work
# run: |
# echo "Setting Tag Images"
# cd /work
# apt-get update && apt-get install git -y || exit 1
# git config --global --add safe.directory /work
# export TAG=$(git describe --exact-match --tags $(git rev-parse HEAD)) || exit 1
# if [ $? -eq 0 ]; then
# export TAG=`echo $TAG | sed 's/^v//'`
# else
# echo "You are not on a tagged branch"
# exit 1
# fi
# echo VERSION=$TAG> env.sh
# echo AUTHOR=$(grep 'service/' packages/packages.json | awk -F/ '{print $2}' | head -1) >> env.sh
# echo SERVICE=$(grep 'service/' packages/packages.json | awk -F/ '{print $3}' | head -1) >> env.sh
# echo AGENT=$(grep 'agent/' packages/packages.json | awk -F/ '{print $3}' | head -1) >> env.sh
# echo DEFAULT_IMAGE_TAG=$(cat packages/packages.json | grep agent/ | awk -F: '{print $2}' | tr -d '", ' | head -n 1) >> env.sh
# cat env.sh
#
# - uses: addnab/docker-run-action@v3
# name: Build Images
# with:
# image: valory/open-autonomy-user:latest
# options: -v ${{ github.workspace }}:/work
# shell: bash
# run: |
# echo "Building Docker Images"
# cd /work
# source env.sh || exit 1
# echo "Building images for $AUTHOR for service $SERVICE"
# autonomy init --reset --author $AUTHOR --ipfs --remote
# autonomy fetch $AUTHOR/$SERVICE --service --local || exit 1
# cd $SERVICE || exit 1
# autonomy build-image || exit 1
# autonomy build-image --version $VERSION || exit 1
#
# - name: Docker login
# run: |
# echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin
# - name: Docker Push
# run: |
# source env.sh
# echo "Pushing $DOCKER_USER/oar-$AGENT:$VERSION"
# echo "Pushing $DOCKER_USER/oar-$AGENT:$DEFAULT_IMAGE_TAG"
# docker push $DOCKER_USER/oar-$AGENT:$VERSION
# docker push $DOCKER_USER/oar-$AGENT:$DEFAULT_IMAGE_TAG
#
# deploy-service-on-propel:
# name: Deploy service on propel
# environment: ${{ github.event.action == 'released' && 'production' || 'staging' }}
# needs:
# - "publish-packages"
# - "publish-images"
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest]
# python-version: ["3.10"]
# env:
# CMD: "propel -U ${{ vars.PROPEL_BASE_URL }}"
# steps:
# - uses: actions/checkout@master
# - uses: actions/setup-python@v3
# with:
# python-version: ${{ matrix.python-versions }}
# - name: Install dependencies
# run: |
# sudo apt-get update --fix-missing
# sudo apt-get autoremove
# sudo apt-get autoclean
# python -m pip install --upgrade pip
# pip install propel-client open-autonomy
#
# - name: Make use proxy instead of actual nlb by dns override
# run: |
# # for staging
# export IP_ADDR=$(dig +short balancer.tcp.propel.staging.autonolas.tech)
# echo -e "\n$IP_ADDR\tapp.propel.staging.valory.xyz\n" | sudo tee -a /etc/hosts
#
# # for prod
# export IP_ADDR=$(dig +short balancer.tcp.propel.autonolas.tech)
# echo -e "\n$IP_ADDR\tapp.propel.valory.xyz\n" | sudo tee -a /etc/hosts
#
# - name: Login to propel
# run: |
# $CMD login -u '${{ vars.PROPEL_USERNAME }}' -p '${{ secrets.PROPEL_PASSWORD }}'
#
# - name: Do a deployment
# run: |
# # determine ipfs hash id
# export IPFS_HASH=$(jq '.dev | to_entries[] | select(.key | startswith("service"))| .value' -r ./packages/packages.json | head -n1)
# export SERVICE_PATH=service_for_propel
#
# # fetch service file and check it published
# autonomy init --reset --author ci --ipfs --remote
# autonomy fetch $IPFS_HASH --service --alias $SERVICE_PATH
#
# # get env vars from github actions
# echo '${{ toJSON(secrets) }}' | jq -r 'to_entries|map("export \(.key)=\(.value|tojson)")|.[]' > github.vars
# echo >> github.vars
# echo '${{ toJSON(vars) }}' | jq -r 'to_entries|map("export \(.key)=\(.value|tojson)")|.[]' >> github.vars
# source github.vars
# $CMD service deploy --name '${{ vars.SERVICE_NAME }}' --service-dir $SERVICE_PATH --service-ipfs-hash $IPFS_HASH --ingress-enabled true --keys '${{ vars.SERVICE_KEYS }}' --timeout 320
build-macos-pyinstaller:
runs-on: macos-latest
strategy:
matrix:
arch: [ x64, arm64 ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- 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: Build with PyInstaller
run: |
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_bin_${{ matrix.arch }} --distpath /dist
- name: Upload Release Assets
uses: actions/upload-artifact@v2
with:
name: trader_bin-${{ matrix.arch }}
path: dist/trader_bin_${{ matrix.arch }}
# create-release:
# needs: build-macos-pyinstaller
# runs-on: ubuntu-latest
#
# steps:
# - name: Download artifacts
# uses: actions/download-artifact@v2
# with:
# name: trader_bin-x64
# path: ./dist/x64
# - name: Download artifacts
# uses: actions/download-artifact@v2
# with:
# name: trader_bin-arm64
# path: ./dist/arm64
#
# - name: Create GitHub Release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# draft: false
# prerelease: false
# files: |
# ./dist/x64/trader_bin
# ./dist/arm64/trader_bin