Build & Publish 669 #10
Workflow file for this run
This file contains 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
# This workflow will upload a Python Package using Twine when a release is created | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Build & Publish 669 | |
on: [ workflow_dispatch ] | |
jobs: | |
compile-linux: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Prepare script | |
run: | | |
cp setup.py thostmduserapi.i thosttraderapi.i 6.6.9/linux64/ | |
- name: Building library | |
working-directory: 6.6.9/linux64 | |
run: python setup.py build_ext | |
- run: ls -al 6.6.9/linux64/target | |
- name: Upload library | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-library | |
path: 6.6.9/linux64/target/ | |
build-linux: | |
runs-on: ubuntu-22.04 | |
needs: | |
- compile-linux | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download library | |
uses: actions/download-artifact@v3 | |
with: | |
name: linux-library | |
path: templates/libs/ | |
- run: ls -al templates/libs | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Generate projects files | |
working-directory: templates | |
run: python sync.py 669 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Building Package | |
working-directory: templates | |
run: | | |
export CIBW_REPAIR_WHEEL_COMMAND= | |
python -m cibuildwheel --platform linux --output-dir ../dist | |
shell: bash | |
- run: ls -al dist/ | |
- name: Store Package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: python-package-distribution | |
path: dist/ | |
compile-macos: | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Prepare script | |
run: | | |
cp setup.py thostmduserapi.i thosttraderapi.i 6.6.9/mac64/ | |
brew install swig | |
- name: Building library | |
working-directory: 6.6.9/mac64 | |
run: python setup.py build_ext | |
- run: ls -al 6.6.9/mac64/target | |
- name: Upload library | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mac-library | |
path: 6.6.9/mac64/target/ | |
build-macos: | |
runs-on: macos-13 | |
needs: | |
- compile-macos | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download library | |
uses: actions/download-artifact@v3 | |
with: | |
name: mac-library | |
path: templates/libs/ | |
- run: ls -al templates/libs | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Generate projects files | |
working-directory: templates | |
run: python sync.py 669 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Building Package | |
working-directory: templates | |
run: | | |
export CIBW_REPAIR_WHEEL_COMMAND= | |
python -m cibuildwheel --platform macos --output-dir ../dist | |
shell: bash | |
- run: ls -al dist/ | |
- name: Store Package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: python-package-distribution | |
path: dist/ | |
compile-windows: | |
runs-on: windows-2022 | |
strategy: | |
matrix: | |
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Prepare script | |
shell: bash | |
run: | | |
cp setup.py 6.6.9/win64/ | |
cp thostmduserapi_win.i 6.6.9/win64/thostmduserapi.i | |
cp thosttraderapi_win.i 6.6.9/win64/thosttraderapi.i | |
- name: Building library | |
shell: bash | |
working-directory: 6.6.9/win64 | |
run: python setup.py build_ext | |
# run: python setup.py | |
- run: ls -al 6.6.9/win64/target | |
shell: bash | |
- name: Upload library | |
uses: actions/upload-artifact@v3 | |
with: | |
name: win-library | |
path: 6.6.9/win64/target | |
build-windows: | |
runs-on: windows-2022 | |
needs: | |
- compile-windows | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download library | |
uses: actions/download-artifact@v3 | |
with: | |
name: win-library | |
path: templates/libs/ | |
- run: ls -al templates/libs | |
shell: bash | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Generate projects files | |
working-directory: templates | |
run: python sync.py 669 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Building Package | |
working-directory: templates | |
run: | | |
export CIBW_REPAIR_WHEEL_COMMAND= | |
python -m cibuildwheel --platform windows --output-dir ../dist | |
shell: bash | |
- run: ls -al dist/ | |
shell: bash | |
- name: Store Package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: python-package-distribution | |
path: dist/ | |
publish-wheel: | |
needs: | |
- build-linux | |
- build-windows | |
- build-macos | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.11 | |
- name: Download Package | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package-distribution | |
path: dist/ | |
- run: ls -al dist/ | |
- name: Publish Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository-url: https://test.pypi.org/legacy/ | |
# - name: Publish to PyPI | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
# with: | |
# password: ${{ secrets.PYPI_API_TOKEN }} | |
test-linux: | |
needs: | |
- publish-wheel | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Modify Ubuntu Locale | |
run: | | |
sudo apt-get install -y locales | |
sudo locale-gen zh_CN.GB18030 | |
- name: Install dependencies | |
run: | | |
pip install pytest | |
- name: Generate projects files | |
working-directory: templates | |
run: python sync.py 669 | |
- name: Install openctp-ctp-669 | |
run: pip install -i https://test.pypi.org/simple/ openctp-ctp-669 | |
# run: pip install openctp-ctp-669 | |
- name: Test | |
working-directory: templates | |
run: pytest tests | |
test-macos: | |
needs: | |
- publish-wheel | |
runs-on: macos-12 | |
strategy: | |
matrix: | |
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
pip install pytest | |
- name: Generate projects files | |
working-directory: templates | |
run: python sync.py 669 | |
- name: Install openctp-ctp-669 | |
run: pip install -i https://test.pypi.org/simple/ openctp-ctp-669 | |
# run: pip install openctp-ctp-669 | |
- name: Test | |
working-directory: templates | |
run: pytest tests | |
test-windows: | |
needs: | |
- publish-wheel | |
runs-on: windows-2022 | |
strategy: | |
matrix: | |
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
pip install pytest | |
- name: Generate projects files | |
working-directory: templates | |
run: python sync.py 669 | |
- name: Install openctp-ctp-669 | |
run: pip install -i https://test.pypi.org/simple/ openctp-ctp-669 | |
# run: pip install openctp-ctp-669 | |
- name: Test | |
working-directory: templates | |
run: pytest tests |