feat: 更新setup.py和__init__.py以反映v2.1.0新特性 #244
This file contains hidden or 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
| # QUANTAXIS 2.1.0 Docker镜像构建和发布 | |
| # | |
| # 触发条件: | |
| # - 推送到master分支 | |
| # - 创建tag (v*.*.*) | |
| # - 手动触发 | |
| # | |
| # 作者: @yutiansut @quantaxis | |
| name: Build and Publish Docker Images | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - develop | |
| tags: | |
| - 'v*.*.*' | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: docker.io | |
| IMAGE_NAME: quantaxis/quantaxis | |
| jobs: | |
| # 测试任务 | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout代码 | |
| uses: actions/checkout@v4 | |
| - name: 设置Python环境 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: 运行兼容性验证 | |
| run: python scripts/verify_compatibility.py | |
| # 构建Docker镜像 | |
| build: | |
| name: Build Docker Image | |
| needs: test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout代码 | |
| uses: actions/checkout@v4 | |
| - name: 设置Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: 登录到Docker Hub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: \${{ secrets.DOCKER_USERNAME }} | |
| password: \${{ secrets.DOCKER_PASSWORD }} | |
| - name: 构建并推送Docker镜像 | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: \${{ github.event_name != 'pull_request' }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |