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
+58 -35
View File
@@ -1,58 +1,81 @@
# Copyright 2026 Tauric Research
# SPDX-License-Identifier: Apache-2.0
name: Bug report
description: Something fails, crashes, or behaves differently from the docs.
labels: ["bug"]
description: TradingAgents fails, crashes or does something other than it should.
labels: [bug]
body:
- type: markdown
attributes:
value: |
Search [existing issues](https://github.com/TauricResearch/TradingAgents/issues?q=is%3Aissue) first, and check that the bug reproduces on the latest release.
Remove API keys and other secrets from anything you paste.
- type: input
id: version
attributes:
label: Version
description: Output of `pip show tradingagents | grep Version`, or `git rev-parse --short HEAD` for a source checkout.
placeholder: "0.5.1"
description: The output of `tradingagents --version`.
validations:
required: true
- type: dropdown
id: entry
id: install
attributes:
label: How you run it
label: How it was installed
options:
- CLI (tradingagents)
- Python package (TradingAgentsGraph)
- Backtest (run_backtest or tradingagents backtest)
- Docker
- Install script
- npm
- Release file
validations:
required: true
- type: dropdown
id: os
attributes:
label: Operating system
options:
- Linux (x64)
- Linux (arm64)
- macOS (Intel)
- macOS (Apple silicon)
- Other
validations:
required: true
- type: dropdown
id: provider
attributes:
label: Provider
options:
- Tauric
- ChatGPT plan
- OpenAI
- Anthropic
- Google
- DeepSeek
- OpenRouter
- OpenAI-compatible server
validations:
required: true
- type: input
id: models
id: model
attributes:
label: LLM provider and models
placeholder: "openai, gpt-6-sol / gpt-6-luna"
validations:
required: true
- type: input
id: run
attributes:
label: Ticker and analysis date
placeholder: "NVDA, 2026-09-23"
label: Model
description: Its `provider/id`, such as `anthropic/claude-opus-5-5`.
- type: textarea
id: what
id: did
attributes:
label: What happened, and what you expected
label: What you did
description: The command or question, and the steps that lead to the problem.
validations:
required: true
- type: textarea
id: repro
id: expected
attributes:
label: Steps or code to reproduce
description: The smallest steps or snippet that shows the problem.
render: python
label: What you expected
validations:
required: true
- type: textarea
id: logs
id: happened
attributes:
label: Error output
description: The full traceback or log lines, as text rather than a screenshot.
render: text
label: What happened
description: The message or output, as shown.
validations:
required: true
- type: textarea
id: transcript
attributes:
label: Transcript or output
description: Optional. The transcript from `/export md`, or an excerpt of the output. Remove keys and anything private first.
render: markdown
+5 -3
View File
@@ -1,8 +1,10 @@
# Copyright 2026 Tauric Research
# SPDX-License-Identifier: Apache-2.0
blank_issues_enabled: false
contact_links:
- name: Questions and showcases
- name: Questions and ideas
url: https://github.com/TauricResearch/TradingAgents/discussions
about: Usage questions, ideas, and projects built on TradingAgents
about: Ask a question or discuss an idea.
- name: Security vulnerability
url: https://github.com/TauricResearch/TradingAgents/security/advisories/new
about: Report privately; please do not open a public issue
about: Report it privately, as SECURITY.md says, not in an issue.
+21 -39
View File
@@ -1,52 +1,34 @@
name: Wrong or missing data
description: A report shows a wrong price, figure, date or company, or data is missing for a symbol.
labels: ["bug", "data"]
# Copyright 2026 Tauric Research
# SPDX-License-Identifier: Apache-2.0
name: Data issue
description: A figure, price, date or company in an answer is wrong or missing.
labels: [bug, data]
body:
- type: markdown
attributes:
value: |
Data is served as of the analysis date: a historical run does not see later prices, filings or news, and some sources (news, StockTwits, Reddit) only serve recent items. A report that says a source is unavailable for a past window is expected.
- type: input
id: symbol
attributes:
label: Ticker and market
placeholder: "0700.HK (Hong Kong)"
validations:
required: true
- type: input
id: date
attributes:
label: Analysis date
placeholder: "2026-09-23"
validations:
required: true
- type: dropdown
id: kind
attributes:
label: Which data
multiple: true
options:
- Prices or indicators
- Fundamentals or statements
- News
- Social (StockTwits, Reddit)
- Macro (FRED)
- Insider transactions
- Prediction markets
- Company identity (wrong company or name)
label: Symbol or series
description: The ticker, instrument or economic series, such as `AAPL` or US CPI.
validations:
required: true
- type: textarea
id: shown
id: answer
attributes:
label: What the report shows, and what is correct
description: Quote the report line, and give the correct value with a public source (exchange page, filing, Yahoo Finance link).
label: What the answer said
description: The question, the figure or statement as written, and the date you asked.
validations:
required: true
- type: input
id: version
- type: textarea
id: source
attributes:
label: Version
placeholder: "0.5.1"
label: The source it cited
description: The line in the sources list for the figure's number, such as `[2]`.
validations:
required: true
- type: textarea
id: right
attributes:
label: What is right
description: The correct figure or fact, with a source for it.
validations:
required: true
+7 -8
View File
@@ -1,16 +1,14 @@
# Copyright 2026 Tauric Research
# SPDX-License-Identifier: Apache-2.0
name: Feature request
description: A capability TradingAgents lacks, or a change to how it works.
labels: ["enhancement"]
description: Suggest a change to TradingAgents.
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Any OpenAI-compatible endpoint already works through the `openai_compatible` provider, and OpenRouter serves many hosted models, so a new LLM provider is often not needed.
- type: textarea
id: problem
attributes:
label: The problem
description: What you are trying to do, and where TradingAgents falls short today.
description: What you are trying to do, and what gets in the way.
validations:
required: true
- type: textarea
@@ -22,4 +20,5 @@ body:
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
label: Alternatives
description: Other ways to solve it, and how you work around it now.
+31
View File
@@ -0,0 +1,31 @@
# Copyright 2026 Tauric Research
# SPDX-License-Identifier: Apache-2.0
# Weekly updates for npm packages and GitHub Actions: minor and patch releases together in one pull
# request, each major on its own. A release is taken only after it has been out a few days, and exact
# versions stay exact.
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
versioning-strategy: increase
cooldown:
default-days: 5
groups:
minor-and-patch:
update-types: [minor, patch]
ignore:
# The types follow the Node.js line the package supports (22), not the newest Node.
- dependency-name: "@types/node"
update-types: ["version-update:semver-major"]
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
cooldown:
default-days: 5
groups:
minor-and-patch:
update-types: [minor, patch]
+136
View File
@@ -0,0 +1,136 @@
# Copyright 2026 Tauric Research
# SPDX-License-Identifier: Apache-2.0
"""Build the project site from README.md: English at the root and one folder per language.
Pages are rendered with GitHub's Markdown API and styled with Primer; relative links point to the
repository on GitHub. A translation is used only when it keeps the README's commands and links.
The output `complete` is true when every language has one.
usage: build.py <out dir> <translations dir> [lang ...]
env: GITHUB_TOKEN, GITHUB_REPOSITORY"""
import json
import os
import re
import sys
import urllib.request
from pathlib import Path
REPO = os.environ.get("GITHUB_REPOSITORY", "TauricResearch/TradingAgents")
BLOB = f"https://github.com/{REPO}/blob/main/"
RAW = f"https://raw.githubusercontent.com/{REPO}/main/"
PRIMER = "https://cdn.jsdelivr.net/npm/@primer"
STYLES = [
f"{PRIMER}/primitives@11.10.0/dist/css/functional/themes/light.css",
f"{PRIMER}/primitives@11.10.0/dist/css/functional/themes/dark.css",
f"{PRIMER}/css@22.3.3/dist/primitives.css",
f"{PRIMER}/css@22.3.3/dist/base.css",
f"{PRIMER}/css@22.3.3/dist/markdown.css",
]
SYNTAX = "".join(
f"{classes}{{color:var(--color-prettylights-syntax-{token})}}"
for classes, token in [
(".pl-c", "comment"),
(".pl-c1,.pl-s .pl-v", "constant"),
(".pl-e,.pl-en", "entity"),
(".pl-ent", "entity-tag"),
(".pl-k", "keyword"),
(".pl-s,.pl-pds,.pl-sr", "string"),
(".pl-smi,.pl-s .pl-s1", "storage-modifier-import"),
(".pl-v,.pl-smw", "variable"),
]
)
TITLE = "TradingAgents: Towards Agentic Finance Research"
def render(markdown: str) -> str:
body = json.dumps({"text": markdown, "mode": "markdown", "context": REPO}).encode()
headers = {
"Authorization": f"Bearer {os.environ['GITHUB_TOKEN']}",
"Accept": "application/vnd.github+json",
}
req = urllib.request.Request("https://api.github.com/markdown", body, headers, method="POST")
with urllib.request.urlopen(req, timeout=60) as resp:
html = resp.read().decode()
def absolute(m: re.Match[str]) -> str:
attr, path = m.group(1), m.group(2)
if re.match(r"[a-z]+:|#|/", path):
return m.group(0)
return f'{attr}="{BLOB if attr == "href" else RAW}{path}"'
return re.sub(r'\b(href|src|srcset)="([^"]+)"', absolute, html)
def page(body: str, lang: str) -> str:
links = "\n".join(f'<link rel="stylesheet" href="{url}">' for url in STYLES)
return f"""<!doctype html>
<html lang="{lang}" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark">
<head><meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{TITLE}</title>
{links}
<style>.markdown-body{{box-sizing:border-box;max-width:980px;margin:0 auto;padding:32px 16px}}
.markdown-body a:not(.anchor){{text-decoration:underline;text-underline-offset:.2rem}}
{SYNTAX}</style>
</head><body><article class="markdown-body">
{body}
</article></body></html>
"""
CODE = re.compile(r"```.*?```", re.S)
LINK = re.compile(r'\]\(([^)\s]+)|(?:href|src|srcset)="([^"]+)"|(https?://[^\s)"\'<>]+)')
def targets(markdown: str) -> set[str]:
return {next(g for g in m.groups() if g) for m in LINK.finditer(markdown)}
def commands(markdown: str) -> list[str]:
"""Code blocks without their comments, then inline code, as written."""
blocks = [re.sub(r"[ \t]+#.*", "", block) for block in CODE.findall(markdown)]
return blocks + sorted(re.findall(r"`[^`\n]+`", CODE.sub("", markdown)))
def translated(english: str, text: str) -> bool:
"""A translation is used when it is the whole README and only that, in another language:
the same first line and closing link, the same link targets, the same commands in code
blocks (their comments may be translated), and at most a fifth of the prose left as is."""
lines, source = text.strip().splitlines(), english.strip().splitlines()
if not lines or lines[0] != source[0] or targets(lines[-1]) != targets(source[-1]):
return False
if commands(text) != commands(english) or targets(text) != targets(english):
return False
prose = [
p
for p in CODE.sub("", english).splitlines()
if len(p) > 30 and not p.lstrip().startswith("<")
]
flat = " ".join(text.split())
return sum(" ".join(p.split()) in flat for p in prose) <= len(prose) / 5
def main() -> None:
out, translations, langs = Path(sys.argv[1]), Path(sys.argv[2]), sys.argv[3:]
english = Path("README.md").read_text(encoding="utf-8")
out.mkdir(parents=True, exist_ok=True)
(out / "index.html").write_text(page(render(english), "en"), encoding="utf-8")
missing = []
for lang in langs:
source = translations / f"{lang}.md"
text = source.read_text(encoding="utf-8") if source.exists() else ""
if not translated(english, text):
missing.append(lang)
continue
(out / lang).mkdir(exist_ok=True)
(out / lang / "index.html").write_text(page(render(text), lang), encoding="utf-8")
if missing:
print(f"::notice::No usable translation for {', '.join(missing)}: the site stays as it is")
with open(os.environ.get("GITHUB_OUTPUT", os.devnull), "a", encoding="utf-8") as f:
f.write(f"complete={'false' if missing else 'true'}\n")
if __name__ == "__main__":
main()
+15
View File
@@ -0,0 +1,15 @@
# Copyright 2026 Tauric Research
# SPDX-License-Identifier: Apache-2.0
model: claude-sonnet-5.5
messages:
- role: system
content: |
Translate the README of TradingAgents, a research agent for markets that runs in the terminal, into {{language}}.
Return only the translated Markdown file: no code fence around it and no note before or after it.
Translate headings, prose, table text and link text, in a clear, natural style.
Keep unchanged: HTML tags and their attributes, the logo, the badges, the language bar, every
URL, code blocks, inline code, commands, file names, environment variables, the citation, and the
names of products, companies and models (TradingAgents, Tauric, ChatGPT, OpenAI, Anthropic, Google,
DeepSeek, OpenRouter).
- role: user
content: "{{readme}}"
+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