Build & Publish 669 #12
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: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout openctp-ctp-669 | |
uses: actions/checkout@v3 | |
with: | |
repository: Jedore/openctp-ctp-669 | |
path: openctp-ctp-669 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Generate projects files | |
run: python templates/sync.py 669 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Building Package | |
working-directory: openctp-ctp-669 | |
run: | | |
export CIBW_REPAIR_WHEEL_COMMAND= | |
python -m cibuildwheel --platform linux --output-dir ../dist | |
shell: bash | |
- name: Store Package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: python-package-distribution | |
path: dist | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout openctp-ctp-669 | |
uses: actions/checkout@v3 | |
with: | |
repository: Jedore/openctp-ctp-669 | |
path: openctp-ctp-669 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Generate projects files | |
run: python templates/sync.py 669 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Building Package | |
working-directory: openctp-ctp-669 | |
run: | | |
export CIBW_REPAIR_WHEEL_COMMAND= | |
python -m cibuildwheel --platform macos --output-dir ../dist | |
shell: bash | |
- name: Store Package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: python-package-distribution | |
path: dist | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout openctp-ctp-669 | |
uses: actions/checkout@v3 | |
with: | |
repository: Jedore/openctp-ctp-669 | |
path: openctp-ctp-669 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Generate projects files | |
run: python templates/sync.py 669 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Building Package | |
working-directory: openctp-ctp-669 | |
run: | | |
export CIBW_REPAIR_WHEEL_COMMAND= | |
python -m cibuildwheel --platform windows --output-dir ../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-latest | |
steps: | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
pip install hatch | |
- name: Download Package | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package-distribution | |
path: dist/ | |
- name: Publish a Python distribution to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
# password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
# repository-url: https://test.pypi.org/legacy/ | |
test-linux: | |
needs: | |
- publish-wheel | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout openctp-ctp-669 | |
uses: actions/checkout@v3 | |
with: | |
repository: Jedore/openctp-ctp-669 | |
path: openctp-ctp-669 | |
- 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 | |
run: python templates/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: openctp-ctp-669 | |
run: pytest tests | |
test-macos: | |
needs: | |
- publish-wheel | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout openctp-ctp-669 | |
uses: actions/checkout@v3 | |
with: | |
repository: Jedore/openctp-ctp-669 | |
path: openctp-ctp-669 | |
- 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 | |
run: python templates/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: openctp-ctp-669 | |
run: pytest tests/test_mdapi.py | |
test-windows: | |
needs: | |
- publish-wheel | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout openctp-ctp-669 | |
uses: actions/checkout@v3 | |
with: | |
repository: Jedore/openctp-ctp-669 | |
path: openctp-ctp-669 | |
- 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 | |
run: python templates/sync.py 669 | |
- name: Install openctp-ctp-669 | |
run: pip install openctp-ctp-669 | |
# run: pip install -i https://test.pypi.org/simple/ openctp-ctp-669 | |
- name: Test | |
working-directory: openctp-ctp-669 | |
run: pytest tests |