-
Notifications
You must be signed in to change notification settings - Fork 3
78 lines (74 loc) · 2.43 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: PyAER Build and Test
on:
push:
release:
types: [published]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Ubuntu dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
gcc --version;
sudo apt-get install build-essential -y;
sudo apt-get install libusb-1.0-0-dev -y;
sudo apt-get install cmake -y;
sudo add-apt-repository ppa:inivation-ppa/inivation -y;
sudo apt-get update;
sudo apt-get install libcaer-dev -y;
- name: Install macos dependencies
if: ${{ matrix.os == 'macos-latest' }}
run: |
gcc --version;
brew install automake;
brew install bison;
brew tap inivation/inivation;
brew install libcaer --with-libserialport --with-opencv;
- name: Install PyAER specific dependencies
run: |
git clone https://github.com/duguyue100/swig
cd swig
./autogen.sh
./configure --without-alllang --with-python=$(command -v python) --without-pcre
make -j4
sudo make install
cd ..
pip install pip -U
pip install numpy
pip install wheel
- name: Build PyAER
run: |
make build-wheel
make build-wheel
make install
- name: Find and manage file
run: |
cd $GITHUB_WORKSPACE/dist
ls -a
for file in *.whl ; do mv $file ${file//linux/manylinux1} ; done;
rm *.egg;
ls -a
cd ..
- name: Publish package to Github releases
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*.*
tag: ${{ github.ref }}
file_glob: true
- name: Publish package to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
pip install twine;
twine upload -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} dist/*.whl;