Skip to content

Build & Publish 651

Build & Publish 651 #5

# 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 651
on: [ workflow_dispatch ]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout openctp-ctp-651
uses: actions/checkout@v3
with:
repository: Jedore/openctp-ctp-651
path: openctp-ctp-651
- 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 651
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Building Package
working-directory: openctp-ctp-651
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-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Checkout openctp-ctp-651
uses: actions/checkout@v3
with:
repository: Jedore/openctp-ctp-651
path: openctp-ctp-651
- 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 651
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Building Package
working-directory: openctp-ctp-651
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
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-651
uses: actions/checkout@v3
with:
repository: Jedore/openctp-ctp-651
path: openctp-ctp-651
- 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 651
- name: Install openctp-ctp-651
# run: pip install -i https://test.pypi.org/simple/ openctp-ctp-651
run: pip install openctp-ctp-651
- name: Test
working-directory: openctp-ctp-651
run: pytest tests
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-651
uses: actions/checkout@v3
with:
repository: Jedore/openctp-ctp-651
path: openctp-ctp-651
- 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 651
- name: Install openctp-ctp-651
run: pip install openctp-ctp-651
# run: pip install -i https://test.pypi.org/simple/ openctp-ctp-651
- name: Test
working-directory: openctp-ctp-651
run: pytest tests