Files
NexQuant/.github/workflows/release.yml
T
TPTBusiness b98c9cd572 feat: Add GitHub infrastructure, CI/CD pipelines, and examples
- Add GitHub issue templates (bug, feature, docs)
- Add pull request template with closed-source checklist
- Add CODEOWNERS for code review assignment
- Add CI/CD workflows (ci, lint, security, docs, release)
  - pytest + coverage with Python 3.10/3.11 matrix
  - Ruff + MyPy code quality checks
  - Bandit + safety security scanning
  - Sphinx docs + GitHub Pages deployment
  - Automated PyPI releases on tag push
- Add 6 comprehensive examples + Jupyter quickstart
  - 01_factor_discovery.py (LLM factor generation)
  - 02_factor_evolution.py (factor optimization)
  - 03_strategy_generation.py (IC-weighted combination)
  - 04_backtest_simple.py (strategy backtesting)
  - 05_model_training.py (XGBoost/LSTM training)
  - 06_rl_trading_agent.py (PPO/DQN/A2C agents)
  - notebooks/quickstart.ipynb (interactive tutorial)
- Restructure .gitignore with explicit closed-source sections
- Add CI/coverage/license badges to README
- Complete CLI docstrings for all 9 commands
- Add data_config.yaml for quant loop configuration
2026-04-11 21:40:18 +02:00

98 lines
2.5 KiB
YAML

name: Release
on:
push:
tags:
- 'v*'
- 'V*'
permissions:
contents: write
packages: write
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Check package
run: twine check dist/*
- name: Verify no closed-source assets
run: |
echo "=== Verifying Release Package ==="
# Extract and check contents
python -c "
import tarfile
import sys
with tarfile.open('dist/' + [f for f in __import__('os').listdir('dist') if f.endswith('.tar.gz')][0], 'r:gz') as tar:
names = tar.getnames()
closed_patterns = ['git_ignore_folder', 'results/', '.env', 'models/local', 'prompts/local']
found = False
for name in names:
for pattern in closed_patterns:
if pattern in name:
print(f'ERROR: Found closed-source asset: {name}')
found = True
if found:
sys.exit(1)
print('✓ No closed-source assets in package')
"
- name: Generate release notes
id: release_notes
run: |
# Try to find changelog for this version
VERSION=${GITHUB_REF#refs/tags/}
CHANGELOG_FILE="changelog/${VERSION}.md"
if [ -f "$CHANGELOG_FILE" ]; then
echo "body_path=$CHANGELOG_FILE" >> $GITHUB_OUTPUT
elif [ -f "CHANGELOG.md" ]; then
# Extract section for this version from main changelog
echo "body_path=CHANGELOG.md" >> $GITHUB_OUTPUT
else
echo "body_path=" >> $GITHUB_OUTPUT
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: ${{ steps.release_notes.outputs.body_path || '' }}
files: dist/*
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/v')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*