Skip to content

Commit ab4b8b2

Browse files
committed
Bring back GitHub Actions, remove Travis
Our Travis infrastructure has become increasingly fragile, with our "open source" deal not really working as it should, which has become increasingly frustrating. Coming back to GitHub Actions should solve this. We previously had GitHub Actions support, but removed it in favor of Travis to gain ARM wheel support. This can be overcome though by using QEMU in GitHub Actions (at least that's how I've done in in other projects), and hopefully natively at some point too. This reverts commit bd800a7, and adds support for ARM wheel builds in GitHub Actions. It also removes the Travis infrastructure since we shouldn't need it anymore.
1 parent 7f55166 commit ab4b8b2

File tree

3 files changed

+86
-132
lines changed

3 files changed

+86
-132
lines changed

.github/workflows/deploy-to-pypi.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Build, test, and upload to PyPI
2+
3+
# Build on every branch push, tag push, and pull request change:
4+
on: [push]
5+
6+
jobs:
7+
build_wheels:
8+
name: Build wheels on ${{matrix.arch}} for ${{ matrix.os }}
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
os: [ubuntu-20.04, windows-2019, macos-10.15]
13+
arch: [auto]
14+
include:
15+
- os: ubuntu-20.04
16+
arch: aarch64
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
with:
21+
submodules: true
22+
23+
- uses: actions/setup-python@v4
24+
name: Install Python
25+
with:
26+
python-version: '3.7'
27+
28+
- uses: docker/setup-qemu-action@v1
29+
if: ${{ matrix.arch == 'aarch64' }}
30+
name: Set up QEMU
31+
32+
- name: Install cibuildwheel
33+
run: |
34+
python -m pip install cibuildwheel
35+
36+
- name: Build wheels
37+
run: |
38+
python -m cibuildwheel --output-dir wheelhouse
39+
env:
40+
CIBW_ARCHS_LINUX: ${{matrix.arch}}
41+
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2"
42+
CIBW_BEFORE_ALL: "bash -c 'cd \"{project}\"; sh .github/tools/install_yajl.sh'"
43+
CIBW_BUILD_VERBOSITY: 1
44+
CIBW_ENVIRONMENT_MACOS: "IJSON_EMBED_YAJL=1"
45+
CIBW_ENVIRONMENT_WINDOWS: "IJSON_EMBED_YAJL=1"
46+
CIBW_TEST_COMMAND: "bash -c 'cd \"{project}\"; pytest -vv'"
47+
CIBW_TEST_REQUIRES: pytest cffi
48+
49+
- uses: actions/upload-artifact@v3
50+
with:
51+
path: ./wheelhouse/*.whl
52+
53+
build_sdist:
54+
name: Build source distribution
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v3
58+
59+
- uses: actions/setup-python@v4
60+
name: Install Python
61+
with:
62+
python-version: '3.7'
63+
64+
- name: Build sdist
65+
run: python setup.py sdist
66+
67+
- uses: actions/upload-artifact@v3
68+
with:
69+
path: dist/*.tar.gz
70+
71+
upload_pypi:
72+
needs: [build_wheels, build_sdist]
73+
runs-on: ubuntu-latest
74+
if: startsWith(github.event.ref, 'refs/tags/v')
75+
steps:
76+
- uses: actions/download-artifact@v3
77+
with:
78+
name: artifact
79+
path: dist
80+
81+
- uses: pypa/gh-action-pypi-publish@master
82+
with:
83+
user: __token__
84+
password: ${{ secrets.pypi_password }}

.travis.yml

Lines changed: 0 additions & 130 deletions
This file was deleted.

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.. image:: https://travis-ci.com/ICRAR/ijson.svg?branch=master
2-
:target: https://travis-ci.com/ICRAR/ijson
1+
.. image:: https://github.com/ICRAR/ijson/actions/workflows/deploy-to-pypi.yml/badge.svg
2+
:target: https://github.com/ICRAR/ijson/actions/workflows/deploy-to-pypi.yml
33

44
.. image:: https://ci.appveyor.com/api/projects/status/32wiho6ojw3eakp8/branch/master?svg=true
55
:target: https://ci.appveyor.com/project/rtobar/ijson/branch/master

0 commit comments

Comments
 (0)