Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 66f49b8

Browse files
authored
fix: Update CI to use GitHub actions and build for osx, windows, linux (#51)
* fix: Update CI to use GitHub actions and build for osx, windows, linux * fix: cleanup commented out code * fix: trigger on release, use pypi.org * fix: add blankline for formatting * fix: add presubmit job as well * fix: remove unnecessary conftest * fix: remove presubmits from kokoro * fix: remove continuous, release from kokoro * fix: update workflow names * fix: remove unused kokoro scripts
1 parent a9a8020 commit 66f49b8

29 files changed

Lines changed: 355 additions & 684 deletions

.github/workflows/presubmit.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
2+
name: Presubmit
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build-source-distribution:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python
15+
uses: actions/setup-python@v2
16+
- name: Build
17+
run: python setup.py sdist
18+
- uses: actions/upload-artifact@v2
19+
with:
20+
name: python-package-distributions
21+
path: dist
22+
23+
build-linux:
24+
runs-on: ubuntu-latest
25+
strategy:
26+
matrix:
27+
python: [3.6, 3.7, 3.8, 3.9]
28+
steps:
29+
- uses: actions/checkout@v2
30+
- name: Set up Python
31+
uses: actions/setup-python@v2
32+
with:
33+
python-version: ${{ matrix.python }}
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install setuptools wheel
38+
- name: Build
39+
run: |
40+
./scripts/manylinux/build.sh
41+
- name: Test Import
42+
run: |
43+
pip install cffi pycparser
44+
pip install --no-index --find-links=wheels google-crc32c
45+
python ./scripts/check_cffi_crc32c.py
46+
- uses: actions/upload-artifact@v2
47+
with:
48+
name: python-package-distributions
49+
path: ./wheels/google_crc32c*.whl
50+
51+
build-macos:
52+
runs-on: macos-latest
53+
strategy:
54+
matrix:
55+
python: [3.6, 3.7, 3.8, 3.9]
56+
steps:
57+
- uses: actions/checkout@v2
58+
- name: Set up Python
59+
uses: actions/setup-python@v2
60+
with:
61+
python-version: ${{ matrix.python }}
62+
- name: Install dependencies
63+
run: |
64+
python -m pip install --upgrade pip
65+
pip install setuptools wheel
66+
- name: Build
67+
run: |
68+
./scripts/osx/build_gh_action.sh
69+
- name: Test Import
70+
run: |
71+
pip install cffi pycparser
72+
pip install --no-index --find-links=wheels google-crc32c
73+
python ./scripts/check_cffi_crc32c.py
74+
- uses: actions/upload-artifact@v2
75+
with:
76+
name: python-package-distributions
77+
path: ./wheels/google_crc32c*.whl
78+
79+
build-windows:
80+
runs-on: windows-latest
81+
strategy:
82+
matrix:
83+
python: [3.6, 3.7, 3.8, 3.9]
84+
steps:
85+
- uses: actions/checkout@v2
86+
- name: Add msbuild to PATH
87+
uses: microsoft/[email protected]
88+
with:
89+
# Use 16.x
90+
vs-version: '[16.0, 17.0)'
91+
- name: Set up Python
92+
uses: actions/setup-python@v2
93+
with:
94+
python-version: ${{ matrix.python }}
95+
- name: Install dependencies
96+
run: |
97+
python -m pip install --upgrade pip
98+
pip install setuptools wheel
99+
- name: Build
100+
run: |
101+
where python
102+
./scripts/windows/build.bat ${{ matrix.python }}
103+
- name: Test Import
104+
run: |
105+
./scripts/windows/test.bat ${{ matrix.python }}
106+
- uses: actions/upload-artifact@v2
107+
with:
108+
name: python-package-distributions
109+
path: ./wheels/google_crc32c*.whl
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
2+
name: Build binary wheels and upload to PyPI
3+
4+
on:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
build-source-distribution:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
15+
- name: Build
16+
run: python setup.py sdist
17+
- uses: actions/upload-artifact@v2
18+
with:
19+
name: python-package-distributions
20+
path: dist
21+
22+
build-linux:
23+
runs-on: ubuntu-latest
24+
strategy:
25+
matrix:
26+
python: [3.6, 3.7, 3.8, 3.9]
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Set up Python
30+
uses: actions/setup-python@v2
31+
with:
32+
python-version: ${{ matrix.python }}
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install setuptools wheel
37+
- name: Build
38+
run: |
39+
./scripts/manylinux/build.sh
40+
- name: Test Import
41+
run: |
42+
pip install cffi pycparser
43+
pip install --no-index --find-links=wheels google-crc32c
44+
python ./scripts/check_cffi_crc32c.py
45+
- uses: actions/upload-artifact@v2
46+
with:
47+
name: python-package-distributions
48+
path: ./wheels/google_crc32c*.whl
49+
50+
build-macos:
51+
runs-on: macos-latest
52+
strategy:
53+
matrix:
54+
python: [3.6, 3.7, 3.8, 3.9]
55+
steps:
56+
- uses: actions/checkout@v2
57+
- name: Set up Python
58+
uses: actions/setup-python@v2
59+
with:
60+
python-version: ${{ matrix.python }}
61+
- name: Install dependencies
62+
run: |
63+
python -m pip install --upgrade pip
64+
pip install setuptools wheel
65+
- name: Build
66+
run: |
67+
./scripts/osx/build_gh_action.sh
68+
- name: Test Import
69+
run: |
70+
pip install cffi pycparser
71+
pip install --no-index --find-links=wheels google-crc32c
72+
python ./scripts/check_cffi_crc32c.py
73+
- uses: actions/upload-artifact@v2
74+
with:
75+
name: python-package-distributions
76+
path: ./wheels/google_crc32c*.whl
77+
78+
build-windows:
79+
runs-on: windows-latest
80+
strategy:
81+
matrix:
82+
python: [3.6, 3.7, 3.8, 3.9]
83+
steps:
84+
- uses: actions/checkout@v2
85+
- name: Add msbuild to PATH
86+
uses: microsoft/[email protected]
87+
with:
88+
# Use 16.x
89+
vs-version: '[16.0, 17.0)'
90+
- name: Set up Python
91+
uses: actions/setup-python@v2
92+
with:
93+
python-version: ${{ matrix.python }}
94+
- name: Install dependencies
95+
run: |
96+
python -m pip install --upgrade pip
97+
pip install setuptools wheel
98+
- name: Build
99+
run: |
100+
where python
101+
./scripts/windows/build.bat ${{ matrix.python }}
102+
- name: Test Import
103+
run: |
104+
./scripts/windows/test.bat ${{ matrix.python }}
105+
- uses: actions/upload-artifact@v2
106+
with:
107+
name: python-package-distributions
108+
path: ./wheels/google_crc32c*.whl
109+
110+
111+
publish:
112+
needs:
113+
- build-linux
114+
- build-macos
115+
- build-windows
116+
- build-source-distribution
117+
runs-on: ubuntu-latest
118+
steps:
119+
- name: Download all the dists
120+
uses: actions/download-artifact@v2
121+
with:
122+
name: python-package-distributions
123+
path: dist/
124+
- name: Download all the wheels
125+
uses: actions/download-artifact@v2
126+
with:
127+
name: python-package-distributions
128+
path: wheels/
129+
- name: What will we publish?
130+
run: ls wheels
131+
- name: Publish Source Distribution
132+
uses: pypa/gh-action-pypi-publish@master
133+
with:
134+
user: __token__
135+
password: ${{ secrets.PYPI_API_TOKEN }}
136+
packages_dir: dist
137+
skip_existing: true
138+
# repository_url: https://test.pypi.org/legacy/
139+
- name: Publish Wheels
140+
uses: pypa/gh-action-pypi-publish@master
141+
with:
142+
user: __token__
143+
password: ${{ secrets.PYPI_API_TOKEN }}
144+
packages_dir: wheels
145+
skip_existing: true
146+
# repository_url: https://test.pypi.org/legacy/

.kokoro/build-manylinux.sh

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

.kokoro/build-osx.sh

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

.kokoro/build.sh

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

0 commit comments

Comments
 (0)