-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Linlang Lv (iSoftStone Information)
committed
Apr 18, 2024
1 parent
0aa6c55
commit a0d80c0
Showing
4 changed files
with
83 additions
and
309 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# This workflows will upload Python Package to testpypi using Twine when a release is created | ||
|
||
|
||
name: Upload qlib package to testpypi | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
|
||
jobs: | ||
deploy_with_bdist_wheel: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macos-11] | ||
# FIXME: macos-latest will raise error now. | ||
# not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 | ||
python-version: [3.7, 3.8] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# This is because on macos systems you can install pyqlib using | ||
# `pip install pyqlib` installs, it does not recognize the | ||
# `pyqlib-<version>-cp38-cp38-macosx_11_0_x86_64.whl` and `pyqlib-<veresion>-cp38-cp37m-macosx_11_0_x86_64.whl`. | ||
# So we limit the version of python, in order to generate a version of qlib that is usable for macos: `pyqlib-<veresion>-cp38-cp37m | ||
# `pyqlib-<version>-cp38-cp38-macosx_10_15_x86_64.whl` and `pyqlib-<veresion>-cp38-cp37m-macosx_10_15_x86_64.whl`. | ||
# Python 3.7.16, 3.8.16 can build macosx_10_15. But Python 3.7.17, 3.8.17 can build macosx_11_0 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
if: matrix.os == 'macos-11' && matrix.python-version == '3.7' | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.7.16" | ||
- name: Set up Python ${{ matrix.python-version }} | ||
if: matrix.os == 'macos-11' && matrix.python-version == '3.8' | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8.16" | ||
- name: Set up Python ${{ matrix.python-version }} | ||
if: matrix.os != 'macos-11' | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build wheel on ${{ matrix.os }} | ||
run: | | ||
pip install numpy | ||
pip install cython | ||
python setup.py bdist_wheel | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} | ||
run: | | ||
twine upload dist/* | ||
deploy_with_manylinux: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build wheel on Linux | ||
uses: RalfG/[email protected]_x86_64 | ||
with: | ||
# not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 | ||
python-versions: 'cp37-cp37m cp38-cp38' | ||
build-requirements: 'numpy cython' | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
- name: Install dependencies | ||
run: | | ||
pip install twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} | ||
run: | | ||
twine upload dist/pyqlib-*-manylinux*.whl |