release: TradingAgents 1.0.0

TradingAgents: Towards Agentic Finance Research. See CHANGELOG.md for what 1.0.0 includes.
This commit is contained in:
Yijia-Xiao
2026-11-24 10:38:36 +00:00
parent 9fa1196fff
commit da95d501c9
437 changed files with 75470 additions and 30659 deletions
+37
View File
@@ -0,0 +1,37 @@
# Copyright 2026 Tauric Research
# SPDX-License-Identifier: Apache-2.0
name: Build
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
# A newer push to the same branch or pull request supersedes a run still going.
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
env:
TRADINGAGENTS_NO_UPDATE_CHECK: "1"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run typecheck
- run: npm run lint
- run: npm run compile
- name: The executable runs as released
run: sh scripts/smoke.sh dist-bin/tradingagents "$RUNNER_TEMP/smoke"
-67
View File
@@ -1,67 +0,0 @@
name: CI
on:
push:
branches: [main, 'v[0-9]+.[0-9]+.[0-9]+']
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: tests (py${{ matrix.python-version }}${{ matrix.tz && format(', {0}', matrix.tz) || '' }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]
# One run away from UTC, so a test that only passes in UTC fails here.
include:
- python-version: "3.12"
tz: America/New_York
env:
TZ: ${{ matrix.tz }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install (with dev extras)
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run test suite
run: pytest -q
smoke-install:
name: clean-install smoke
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Fresh install (no dev extras) and import
run: |
python -m pip install --upgrade pip
pip install .
# Catches undeclared runtime deps (e.g. #994 python-dotenv): a bare
# install must import the package and the CLI module.
python -c "import tradingagents, cli.main; print('clean-install import OK')"
lint:
name: ruff (strict, full repo)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install ruff
run: pip install "ruff>=0.16"
- name: Lint the repository
# The repo is fully clean under the strict select, so we lint everything
# (generated results/ is excluded via pyproject extend-exclude).
run: ruff check .
+74
View File
@@ -0,0 +1,74 @@
# Copyright 2026 Tauric Research
# SPDX-License-Identifier: Apache-2.0
name: npm
# When a release is published, its executables go to npm: a package per platform (@tauric/tradingagents-*)
# and @tauric/tradingagents, whose tradingagents command runs the one for the platform it is installed on. The files
# are the release's own, checked against its SHA256SUMS. Publishing is by npm's trusted publishing (this
# workflow's OIDC identity, no stored token), which records provenance. The release workflow checks the
# packages can be written and packed before the release is drafted.
on:
release:
types: [published]
permissions: {}
concurrency:
group: npm-${{ github.event.release.tag_name }}
jobs:
npm:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
env:
TAG: ${{ github.event.release.tag_name }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.release.tag_name }}
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
registry-url: https://registry.npmjs.org
cache: npm
- name: The tag names this version
run: test "$TAG" = "v$(node -p 'require("./package.json").version')"
- run: npm ci --ignore-scripts
- name: The release's executables, as checked against its SHA256SUMS
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
gh release download "$TAG" --dir release --pattern 'tradingagents-*' --pattern SHA256SUMS
cd release && sha256sum --check --strict SHA256SUMS
- name: Write the packages
run: npx bun scripts/npm-packages.ts "${TAG#v}" release packages
- name: Publish, the platform packages first
# @tauric/tradingagents goes last, once npm serves every package it depends on; a version
# already on npm is left as it is, so a run can be repeated.
run: |
version=${TAG#v}
case $version in *-*) tag=next ;; *) tag=latest ;; esac
# npm says nothing (and succeeds) for a version a package does not have.
served() { [ -n "$(npm view "$1@$version" version $2 2>/dev/null)" ]; }
publish() {
name=$(node -p "require('./$1/package.json').name")
if served "$name"; then
echo "$name@$version is on npm already"
return
fi
npm publish "./$1" --tag "$tag"
}
for dir in packages/tradingagents-*; do publish "$dir"; done
for dir in packages/tradingagents-*; do
name=$(node -p "require('./$dir/package.json').name")
for attempt in $(seq 60); do
served "$name" --prefer-online && break
[ "$attempt" -lt 60 ] || { echo "$name@$version is not served yet"; exit 1; }
sleep 10
done
done
publish packages/tradingagents
+97
View File
@@ -0,0 +1,97 @@
# Copyright 2026 Tauric Research
# SPDX-License-Identifier: Apache-2.0
name: Site
on:
push:
branches: [main]
paths: [README.md, .github/site/**, .github/workflows/pages.yml]
permissions:
contents: read
concurrency:
group: pages
cancel-in-progress: false
jobs:
translate:
runs-on: ubuntu-latest
environment: readme-translation
strategy:
fail-fast: false
matrix:
include:
- { lang: de, language: German }
- { lang: es, language: Spanish }
- { lang: fr, language: French }
- { lang: ja, language: Japanese }
- { lang: ko, language: Korean }
- { lang: pt, language: Portuguese }
- { lang: ru, language: Russian }
- { lang: zh, language: Simplified Chinese }
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- env:
COPILOT_CLI_VERSION: 1.0.105
run: npm install -g "@github/copilot@$COPILOT_CLI_VERSION"
- id: ai
# A failed translation leaves the published site unchanged.
continue-on-error: true
uses: actions/ai-inference@2c43c91ae16266ca159d311430343c67a5ffa222 # v3
with:
prompt-file: .github/site/translate.prompt.yml
input: "language: ${{ matrix.language }}"
file_input: "readme: README.md"
env:
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
- if: steps.ai.outcome == 'success'
env:
RESPONSE: ${{ steps.ai.outputs.response-file }}
run: mkdir -p translations && cp "$RESPONSE" "translations/${{ matrix.lang }}.md"
- if: steps.ai.outcome == 'success'
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: translation-${{ matrix.lang }}
path: translations/
retention-days: 1
build:
needs: translate
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
complete: ${{ steps.build.outputs.complete }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
continue-on-error: true
with:
pattern: translation-*
path: translations
merge-multiple: true
- id: build
env:
GITHUB_TOKEN: ${{ github.token }}
run: python3 .github/site/build.py _site translations de es fr ja ko pt ru zh
- if: steps.build.outputs.complete == 'true'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
deploy:
needs: build
if: needs.build.outputs.complete == 'true'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- id: deploy
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
-59
View File
@@ -1,59 +0,0 @@
name: Release assets
# Builds the source archive and wheel from the release tag and attaches them to
# the GitHub release, so a version can be installed without cloning:
# pip install https://github.com/TauricResearch/TradingAgents/releases/download/<tag>/<wheel>
# Run it by hand with a tag to attach builds to an earlier release.
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Release tag to build and attach, for example v0.6.0"
required: true
permissions: {}
concurrency:
group: release-assets-${{ inputs.tag || github.event.release.tag_name }}
cancel-in-progress: false
jobs:
build:
name: build and attach
runs-on: ubuntu-latest
permissions:
contents: write
env:
TAG: ${{ inputs.tag || github.event.release.tag_name }}
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v7
with:
# Release branches share their tag's name, so name the tag explicitly.
ref: refs/tags/${{ env.TAG }}
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- name: Check the package version matches the tag
run: |
version=$(python -c "import re, pathlib; print(re.search(r'__version__ = \"([^\"]+)\"', pathlib.Path('tradingagents/__init__.py').read_text()).group(1))")
if [ "v$version" != "$TAG" ]; then
echo "tradingagents/__init__.py says $version, but the tag is $TAG"
exit 1
fi
- name: Build the source archive and wheel
run: |
python -m pip install --upgrade build
python -m build
- name: Install the wheel in a clean environment
run: |
python -m venv /tmp/smoke
/tmp/smoke/bin/pip install dist/*.whl
# From another directory, so the imports come from the wheel, not the checkout.
cd /tmp
/tmp/smoke/bin/python -c "import importlib.resources as r, tradingagents, cli.main; assert (r.files('cli') / 'static' / 'welcome.txt').is_file(); print('wheel install OK', tradingagents.__version__)"
- name: Attach them to the release
run: gh release upload "$TAG" dist/* --clobber --repo "$GITHUB_REPOSITORY"
+170
View File
@@ -0,0 +1,170 @@
# Copyright 2026 Tauric Research
# SPDX-License-Identifier: Apache-2.0
name: Release
# A version tag builds the executables once, signs the macOS ones, runs those same files on each
# platform, and makes a draft release of them with their checksums and the version's CHANGELOG.md
# notes; the draft's files are then checked against what was built. The draft is published by hand.
on:
push:
tags: ["v*"]
permissions: {}
env:
TRADINGAGENTS_NO_UPDATE_CHECK: "1"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 22
cache: npm
- name: The tag names this version
env:
TAG: ${{ github.ref_name }}
run: test "$TAG" = "v$(node -p 'require("./package.json").version')"
- run: npm ci
- name: CHANGELOG.md has this version's notes
env:
TAG: ${{ github.ref_name }}
run: mkdir -p notes && npx bun scripts/release-notes.ts "$TAG" > notes/notes.md
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: notes
path: notes/
if-no-files-found: error
retention-days: 1
- run: npm run typecheck
- run: npm run lint
- run: npm run build
- name: Build the executables
# Each on the target's Bun runtime as package-lock.json locks it, checked by its sha512.
run: |
for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64; do
runtime=$(npx bun scripts/runtime.ts "bun-$target" "$RUNNER_TEMP/runtimes")
npx bun scripts/compile.ts "release/tradingagents-$target" "bun-$target" "$runtime"
done
cp scripts/install.sh release/
- name: The npm packages can be written and packed
# Published from the release's own files when it is published (npm.yml); checked here first.
env:
TAG: ${{ github.ref_name }}
run: |
npx bun scripts/npm-packages.ts "${TAG#v}" release "$RUNNER_TEMP/npm"
for dir in "$RUNNER_TEMP"/npm/*; do npm pack --dry-run "$dir"; done
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: built
path: release/
if-no-files-found: error
retention-days: 1
sign:
# A macOS executable whose signature no longer holds (one inherited from Bun's own) is signed again
# ad hoc; the checksums are of the files as released.
needs: build
runs-on: macos-15
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: built
path: release
- name: Sign where needed, and checksum
run: |
cd release
for bin in tradingagents-darwin-*; do
codesign --verify --strict "$bin" 2>/dev/null || codesign --force --sign - "$bin"
codesign --verify --strict --verbose=2 "$bin"
done
shasum -a 256 tradingagents-* > SHA256SUMS
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: release
path: release/
if-no-files-found: error
retention-days: 30
smoke:
needs: sign
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-24.04, target: linux-x64 }
- { os: ubuntu-24.04-arm, target: linux-arm64 }
- { os: macos-15-intel, target: darwin-x64 }
- { os: macos-15, target: darwin-arm64 }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: release
path: release
- name: Install with the install script, from this run's files
env:
TAG: ${{ github.ref_name }}
run: |
export TRADINGAGENTS_RELEASE_URL="file://$PWD/release" TRADINGAGENTS_INSTALL_DIR="$RUNNER_TEMP/bin"
sh release/install.sh
test "v$("$TRADINGAGENTS_INSTALL_DIR/tradingagents" --version)" = "$TAG"
- name: The signature holds
if: runner.os == 'macOS'
run: codesign --verify --strict --verbose=2 "$RUNNER_TEMP/bin/tradingagents"
- name: The executable runs as released
run: sh scripts/smoke.sh "$RUNNER_TEMP/bin/tradingagents" "$RUNNER_TEMP/smoke"
draft:
# A draft only: it is not seen outside the repository until it is published.
needs: smoke
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: release
path: release
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: notes
path: notes
- name: Make the draft release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
TAG: ${{ github.ref_name }}
run: |
case $TAG in *-*) pre=--prerelease ;; *) pre= ;; esac
gh release create "$TAG" release/* --draft $pre --verify-tag --title "$TAG" --notes-file notes/notes.md
assets:
# The draft holds exactly the files built, each as built.
needs: draft
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: release
path: built
- name: The draft's files are the ones built
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
TAG: ${{ github.ref_name }}
run: |
gh release download "$TAG" --dir drafted
diff <(ls built) <(ls drafted)
cd drafted && sha256sum -c SHA256SUMS && cmp install.sh ../built/install.sh