Merge pull request #118 from dvilelaf/fix/temperature #23
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 Flow | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
workflow_dispatch: | |
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 | |
pip install --upgrade poetry | |
poetry install | |
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 | |
build-macos-pyinstaller: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macos-14, macos-14-large ] | |
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: Set arch environment variable for macos-latest-large | |
if: contains(matrix.os, 'large') | |
run: echo "OS_ARCH=x64" >> $GITHUB_ENV | |
- name: Set arch environment variable for other macOS versions | |
if: ${{ !contains(matrix.os, 'large') }} | |
run: echo "OS_ARCH=arm64" >> $GITHUB_ENV | |
- 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 --collect-all twikit --collect-all twitter_text_parser --collect-all textblob --onefile pyinstaller/memeooorr_bin.py --name memeooorr_bin_${{env.OS_ARCH}} | |
- name: Upload Release Assets | |
uses: actions/upload-artifact@v4 | |
with: | |
name: memeooorr_bin_${{env.OS_ARCH}} | |
path: dist/memeooorr_bin_${{env.OS_ARCH}} | |
upload-assets: | |
needs: build-macos-pyinstaller | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: memeooorr_bin_x64 | |
path: ./dist/ | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: memeooorr_bin_arm64 | |
path: ./dist/ | |
- name: Publish Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
./dist/memeooorr_bin_x64 | |
./dist/memeooorr_bin_arm64 |