Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Commit 33def0a

Browse files
author
hauntsaninja
committed
Use Github Actions + cibuildwheel for all wheels
1 parent 8eed936 commit 33def0a

File tree

7 files changed

+124
-188
lines changed

7 files changed

+124
-188
lines changed

.github/workflows/build.yml

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Build wheels
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags: ['*']
7+
8+
jobs:
9+
build_wheels:
10+
name: py${{ matrix.python-version }} on ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
# cibuildwheel builds linux wheels inside a manylinux container
16+
# it also takes care of procuring the correct python version for us
17+
os: [ubuntu-latest, windows-latest, macos-latest]
18+
python-version: [36, 37, 38, 39, 310]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/setup-python@v2
23+
name: Install Python
24+
with:
25+
python-version: "3.9"
26+
- name: Install cibuildwheel
27+
run: |
28+
python -m pip install "cibuildwheel==2.1.3"
29+
- name: Build wheels
30+
env:
31+
CIBW_BUILD: "cp${{ matrix.python-version }}-*"
32+
CIBW_SKIP: "*-manylinux_i686 *-win32"
33+
CIBW_BUILD_VERBOSITY: 1
34+
run: |
35+
python -m cibuildwheel --output-dir wheelhouse .
36+
- uses: actions/upload-artifact@v2
37+
with:
38+
name: dist
39+
path: ./wheelhouse/*.whl
40+
build_sdist_python_wheel:
41+
name: sdist and python wheel
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v2
45+
- uses: actions/setup-python@v2
46+
name: Install Python
47+
with:
48+
python-version: "3.9"
49+
- name: Run check-manifest
50+
run: |
51+
pip install check-manifest
52+
check-manifest -v
53+
- name: Build sdist and wheel
54+
run: |
55+
pip install --upgrade setuptools pip wheel
56+
python setup.py sdist
57+
- uses: actions/upload-artifact@v2
58+
with:
59+
name: dist
60+
path: |
61+
dist/*.tar.gz
62+
release:
63+
name: create release
64+
needs: [build_wheels, build_sdist_python_wheel]
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Download artifact
68+
uses: actions/download-artifact@v2
69+
with:
70+
name: dist
71+
path: dist
72+
- name: Release
73+
# https://github.com/actions/upload-release-asset/issues/47
74+
uses: actions/github-script@v2
75+
with:
76+
github-token: ${{secrets.GITHUB_TOKEN}}
77+
script: |
78+
const fs = require('fs').promises;
79+
const { repo: { owner, repo }, sha } = context;
80+
81+
console.log('environment', process.versions);
82+
console.log({ owner, repo, sha });
83+
84+
const release = await github.repos.createRelease({
85+
owner, repo,
86+
// if GITHUB_REF just appears to be a branch, use tag-{commit} as the tag
87+
tag_name: process.env.GITHUB_REF.includes("refs/heads/") ? "tag-" + sha : process.env.GITHUB_REF.split("/").pop(),
88+
target_commitish: sha
89+
});
90+
91+
console.log('created release', { release });
92+
93+
for (let file of await fs.readdir('dist')) {
94+
console.log('uploading', file);
95+
96+
await github.repos.uploadReleaseAsset({
97+
owner, repo,
98+
release_id: release.data.id,
99+
name: file,
100+
data: await fs.readFile(`./dist/${file}`)
101+
});
102+
}

.travis/build-linux-wheels.sh

-14
This file was deleted.

MANIFEST.in

+13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1+
include ast27/Grammar/Grammar
2+
include ast27/Parser/Python.asdl
13
recursive-include ast27 *.h
4+
recursive-include ast27 *.py
5+
6+
include ast3/Grammar/Grammar
7+
include ast3/Parser/Python.asdl
28
recursive-include ast3 *.h
9+
recursive-include ast3 *.py
10+
311
recursive-include ast3/tests *.py
412
include LICENSE
13+
14+
prune tools
15+
exclude CONTRIBUTING.md
16+
exclude release_process.md
17+
exclude update_process.md

appveyor.yml

-31
This file was deleted.

install_python.ps1

-37
This file was deleted.

release_process.md

+9-28
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,12 @@
88
2. Make a git tag pointing to this commit with the version number as the name
99
of the tag.
1010
3. Push the commit and the tag.
11-
4. Wait for the Travis CI and Appveyor builds to complete.
12-
5. Make sure there's nothing in your `typed_ast/dist` directory.
13-
6. Run `python3 setup.py sdist` (this creates `dist/typed-ast-VERSION.tar.gz`).
14-
7. Download the wheels from Travis-CI and Appveyor.
15-
- Do this using `tools/download_typed_ast.py`. If you run into issues,
16-
download them manually:
17-
- Find the Appveyor build for the tag
18-
[here](https://ci.appveyor.com/project/ddfisher/typed-ast-a4xqu/history) and
19-
download the artifact produced by each job into the `dist` directory.
20-
- Download [the latest manylinux
21-
wheels](https://console.cloud.google.com/storage/browser/typed-ast) into the
22-
`dist` directory. (You will have to sign in with your Google account to
23-
access these wheels, but all Google accounts have access.)
24-
25-
8. On a Mac with Python 3.6, 3.7, 3.8 and 3.9 installed, run
26-
`python3.6 setup.py bdist_wheel`, `python3.7 setup.py bdist_wheel`,
27-
`python3.8 setup.py bdist_wheel` and `python3.9 setup.py bdist_wheel`
28-
(this creates wheels in `dist`).
29-
9. Confirm that the wheels for MacOS target `macosx_10_9` (and not say,
30-
`macosx_10_15`). You may need `export MACOSX_DEPLOYMENT_TARGET=10.9` and
31-
possibly to recompile Python with that environment variable set.
32-
10. Compare the wheels produced to previous release of typed-ast to make sure
33-
you have the full matrix.
34-
11. If possible, verify the final `typed_ast` wheels work on Windows, MacOS,
35-
and Linux platforms.
36-
12. Upload the sdist and wheels to PyPI with `twine upload dist/*`.
37-
13. Make a commit which bumps the bugfix version and adds back the `.dev0`
38-
suffix.
11+
4. Wait for the Github Actions build to complete.
12+
5. Download all assets from the release made by the Github build.
13+
6. Compare the wheels produced to previous release of typed-ast to make sure
14+
you have the full matrix.
15+
7. If possible, verify the final `typed_ast` wheels work on Windows, MacOS,
16+
and Linux platforms.
17+
8. Upload the sdist and wheels to PyPI with `twine upload dist/*`.
18+
9. Make a commit which bumps the bugfix version and adds back the `.dev0`
19+
suffix.

tools/download_typed_ast.py

-78
This file was deleted.

0 commit comments

Comments
 (0)