add additional download link #157
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 install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python application | |
on: | |
push: | |
branches: [ master, debugging ] | |
tags: | |
- "v*.*.*" | |
pull_request: | |
branches: [ master ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
run: | |
runs-on: ${{ matrix.os }} | |
env: | |
VERSION: 1.1.12 | |
strategy: | |
matrix: | |
# python-version: [3.7, 3.8, 3.9, "3.10"] | |
# os: ['windows-latest', 'ubuntu-latest', 'macos-latest'] | |
# os: ['ubuntu-latest', 'macos-10.15', 'macos-latest'] | |
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] | |
os: ['ubuntu-20.04', 'macos-10.15', 'windows-2019'] | |
fail-fast: false | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.18' | |
- name: Setup cmake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: '3.16.x' | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -U flake8 pytest scikit-build cython ninja auditwheel | |
- name: Install dependencies on the linux platform | |
if: ${{ matrix.os == 'ubuntu-20.04' }} | |
run: | | |
sudo apt update | |
sudo apt-get install libusb-1.0-0-dev libudev-dev | |
python -m pip install -U patchelf | |
# - name: Lint with flake8 | |
# run: | | |
# # stop the build if there are Python syntax errors or undefined names | |
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Build pyeoskit | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: get whl file | |
id: whlfile | |
shell: bash | |
run: | | |
echo "value=`python scripts/get_whl_file.py dist`" >> $GITHUB_OUTPUT | |
- name: Install pyeoskit | |
run: | | |
python -m pip uninstall pyeoskit -y;python -m pip install ./dist/${{ steps.whlfile.outputs.value }} | |
- name: Test | |
working-directory: ./pytest | |
run: | | |
python3 -m pytest test_c_apis.py | |
- name: auditwheel repair | |
if: ${{ matrix.os == 'ubuntu-20.04' }} | |
id: manylinuxwhlfile | |
working-directory: ./dist | |
run: | | |
python -m auditwheel repair --plat manylinux_2_17_x86_64 ${{ steps.whlfile.outputs.value }} | |
echo "value=`python ../scripts/get_whl_file.py ./wheelhouse manylinux`" >> $GITHUB_OUTPUT | |
echo "+++manylinuxwhlfile: ${{ steps.manylinuxwhlfile.outputs.value }}" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
./dist/${{ steps.whlfile.outputs.value }} | |
- name: Release manylinux wheel | |
if: ${{ matrix.os == 'ubuntu-20.04' && startsWith(github.ref, 'refs/tags/') }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./dist/wheelhouse/${{ steps.manylinuxwhlfile.outputs.value }} | |
- name: Downloading whl files | |
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.10' }} | |
working-directory: dist | |
run: | | |
python ../scripts/download.py ${{ env.VERSION }} | |
rm pyeoskit-${{ env.VERSION }}-cp310-cp310-linux_x86_64.whl | |
rm -r wheelhouse | |
- name: Upload wheel checksums | |
uses: softprops/action-gh-release@v1 | |
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.10' }} | |
with: | |
files: | | |
./dist/checksum.txt | |
- name: Remove dist/checksum.txt | |
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.10' }} | |
run: | | |
rm ./dist/checksum.txt | |
- name: Publish a Python distribution to PyPI | |
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.10' }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |