trying to setup context manager #70
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
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; |