Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/v2/cloud deploy #51

Open
wants to merge 5 commits into
base: v2-develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ None: Automated tests are acceptable.
## Deployment instructions
-->

<!-- If you are on Discord, please join https://discord.gg/ai16z and state your Discord username here for the contributor role and join us in #development-feed -->
<!-- If you are on Discord, please join https://discord.gg/elizaOS and state your Discord username here for the contributor role and join us in #development-feed -->
<!--
## Discord username

Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/fetch-news.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Fetch News Files

on:
schedule:
- cron: '0 0 * * *' # Run daily at midnight UTC
workflow_dispatch: # Allow manual triggering

jobs:
fetch-news:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: autodocs

- name: Run news fetcher
run: |
chmod +x docs/scripts/fetch-news.sh
./docs/scripts/fetch-news.sh

- name: Commit and push if changes exist
run: |
git config --global user.name 'GitHub Actions Bot'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add docs/news/
git diff --quiet && git diff --staged --quiet || (git commit -m "Auto-update news files" && git push origin autodocs)
50 changes: 50 additions & 0 deletions .github/workflows/generate-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Update Changelog

on:
release:
types: [published]

jobs:
update_changelog:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Configure Git
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"

- name: Check if autodocs branch exists and create or switch to it
run: |
if git ls-remote --heads origin autodocs | grep autodocs; then
echo "Branch autodocs exists, checking out"
git checkout autodocs
git pull origin autodocs
else
echo "Branch autodocs doesn't exist, creating"
git checkout -b autodocs
fi

- name: Generate changelog
run: python3 docs/scripts/get-changelog.py --output docs/docs/changelog.md
env:
GITHUB_TOKEN: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}

- name: Commit and push changes
run: |
git add docs/changelog.md
git commit -m "docs: update changelog for ${{ github.event.release.tag_name }}" || echo "No changes to commit"
git push origin autodocs
env:
GITHUB_TOKEN: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
148 changes: 87 additions & 61 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
@@ -1,70 +1,96 @@
#

name: Create and publish a Docker image

# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
release:
types: [created]
workflow_dispatch:
workflow_dispatch:
# push:
# pull_request:

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
build-and-push-image:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
attestations: write
id-token: write
#
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Uses the `docker/login-action` action to log in to the Container registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Configure AWS credentials
uses: meta-introspector/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION || 'us-east-2'}}
role-session-name: github-actions-${{ env.APP_NAME || 'eliza'}}
# FIXME hard coded
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID || '767503528736' }}:role/github

- name: Set up Docker Buildx
uses: meta-introspector/setup-buildx-action@v3.8.0
with:
install: true
platforms: linux/amd64,linux/arm/v7,linux/arm/v8

- name: Login to Amazon ECR
id: login-ecr
uses: meta-introspector/amazon-ecr-login@v1

- name: Set short sha
id: sha_short
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Login to Docker Hub
uses: meta-introspector/login-action@v3
with:
username: ${{ vars.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Checkout repository
uses: meta-introspector/checkout@v4

- name: Log in to the Container registry
uses: meta-introspector/login-action@v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: meta-introspector/metadata-action@v5.5.1
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
h4ckermike/elizaos-eliza
${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY || 'agent/eliza'}}

- name: Build and push Docker image
id: push
uses: meta-introspector/build-push-action@v6.10.0
with:
platforms: linux/arm64,linux/arm64/v8
context: .
push: true
tags: |
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)."
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
- name: Generate artifact attestation
uses: meta-introspector/attest-build-provenance@local
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

# This step makes the Docker image public, so users can pull it without authentication.
- name: Make Docker image public
run: |
curl \
-X PATCH \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/user/packages/container/${{ env.IMAGE_NAME }}/visibility \
-d '{"visibility":"public"}'
- name: Make Docker image public
run: |
curl \
-X PATCH \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/user/packages/container/${{ env.IMAGE_NAME }}/visibility \
-d '{"visibility":"public"}'
38 changes: 17 additions & 21 deletions .github/workflows/integrationTests.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Integration Tests

on:
push:
branches:
Expand All @@ -8,36 +7,33 @@ on:
branches:
- "*"

env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}

jobs:
integration-tests:
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_CACHE: remote:rw
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Bun
uses: oven-sh/setup-bun@v2
- uses: actions/checkout@v4
with:
submodules: true # Ensures submodules are checked out

- name: Install Node.js
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v3
with:
node-version: "23"
version: 9.15.0

- name: Install required packages
run: |
sudo apt update
sudo apt -y install build-essential pkg-config libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
- uses: actions/setup-node@v4
with:
node-version: "23.3"
cache: "pnpm"

- name: Install dependencies
run: bun install
run: pnpm install --no-frozen-lockfile

- name: Build packages
run: bun run build
run: pnpm build

- name: Check for API key
run: |
Expand All @@ -47,4 +43,4 @@ jobs:
fi

- name: Run integration tests
run: bun run test
run: pnpm run integrationTests
39 changes: 39 additions & 0 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: smoke-test
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"

jobs:
smoke-tests:
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_CACHE: remote:rw
steps:
- uses: actions/checkout@v4
with:
submodules: true # Ensures submodules are checked out
- uses: pnpm/action-setup@v3
with:
version: 9.15.0

- uses: actions/setup-node@v4
with:
node-version: "23.3"
cache: "pnpm"

- name: Run smoke tests
run: pnpm run smokeTests

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{env.MODIFIED_BRANCH_NAME}}
path: ${{env.OUTPUT_TEST_DIR}}
Loading
Loading